Package jenkins.model
Class ArtifactManager
java.lang.Object
jenkins.model.ArtifactManager
- Direct Known Subclasses:
StandardArtifactManager
Manager of artifacts for one build.
- Since:
- 1.532
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
archive
(FilePath workspace, Launcher launcher, BuildListener listener, Map<String, String> artifacts) Archive all configured artifacts from a build.abstract boolean
delete()
Delete all artifacts associated with an earlier build (if any).abstract void
Called when this manager is loaded from disk.abstract VirtualFile
root()
Returns a representation of the root directory of archived artifacts.
-
Constructor Details
-
ArtifactManager
public ArtifactManager()
-
-
Method Details
-
onLoad
Called when this manager is loaded from disk. The selected manager will be persisted inside a build, so the build reference should betransient
(quasi-final
) and restored here.- Parameters:
build
- a historical build with which this manager was associated
-
archive
public abstract 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.jpg
if 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.COMPLETED
when this is called (since it is the parent build which is still running and performing archiving).- Parameters:
workspace
- the root directory from which to copy files (typicallyAbstractBuild.getWorkspace()
but not necessarily)launcher
- a launcher to use if external processes need to be forkedlistener
- a way to print messages about progress or problemsartifacts
- map from paths in the archive area to paths relative toworkspace
(all paths/
-separated)- Throws:
IOException
- if transfer or copying failed in any wayInterruptedException
- if transfer was interrupted- See Also:
-
delete
Delete all artifacts associated with an earlier build (if any).- Returns:
- true if there was actually anything to delete
- Throws:
IOException
- if deletion could not be completedInterruptedException
- if deletion was interrupted
-
root
Returns a representation of the root directory of archived artifacts.- Returns:
- the archive root
-