public class StandardArtifactManager extends ArtifactManagerDefault artifact manager which transfers files over the remoting channel and stores them inside the build directory. May be subclassed to provide an artifact manager which uses the standard storage but which only overrides
archive(hudson.FilePath, hudson.Launcher, hudson.model.BuildListener, java.util.Map<java.lang.String, java.lang.String>).
All Methods Instance Methods Concrete Methods Modifier and Type Method Description
archive(FilePath workspace, Launcher launcher, BuildListener listener, Map<String,String> artifacts)Archive all configured artifacts from a build.
delete()Delete all artifacts associated with an earlier build (if any).
onLoad(Run<?,?> build)Called when this manager is loaded from disk.
root()Returns a representation of the root directory of archived artifacts.
public StandardArtifactManager(Run<?,?> build)
public final void onLoad(Run<?,?> build)Called when this manager is loaded from disk. The selected manager will be persisted inside a build, so the build reference should be
final) and restored here.
public void archive(FilePath workspace, Launcher launcher, BuildListener listener, Map<String,String> artifacts) throws IOException, InterruptedExceptionArchive all configured artifacts from a build.
If called multiple times for the same build, do not delete the old artifacts but keep them all, unless overwritten. For example, the XVNC plugin could use this to save
screenshot.jpgif so configured.
This method is typically invoked on a running build, though e.g. in the case of Maven module builds, the build may actually be
Run.State.COMPLETEDwhen this is called (since it is the parent build which is still running and performing archiving).
- Specified by:
workspace- the root directory from which to copy files (typically
AbstractBuild.getWorkspace()but not necessarily)
launcher- a launcher to use if external processes need to be forked
listener- a way to print messages about progress or problems
artifacts- map from paths in the archive area to paths relative to
IOException- if transfer or copying failed in any way
InterruptedException- if transfer was interrupted
- See Also:
SimpleBuildStep.perform(Run, FilePath, Launcher, TaskListener)
public final boolean delete() throws IOException, InterruptedExceptionDelete all artifacts associated with an earlier build (if any).