public class StandardArtifactManager extends ArtifactManager
archive(hudson.FilePath, hudson.Launcher, hudson.model.BuildListener, java.util.Map<java.lang.String, java.lang.String>)
.Modifier and Type | Field and Description |
---|---|
protected Run<?,?> |
build |
static FilePath.TarCompression |
TAR_COMPRESSION |
Constructor and Description |
---|
StandardArtifactManager(Run<?,?> build) |
Modifier and Type | Method and Description |
---|---|
void |
archive(FilePath workspace,
Launcher launcher,
BuildListener listener,
Map<String,String> artifacts)
Archive all configured artifacts from a build.
|
boolean |
delete()
Delete all artifacts associated with an earlier build (if any).
|
void |
onLoad(Run<?,?> build)
Called when this manager is loaded from disk.
|
VirtualFile |
root()
Returns a representation of the root directory of archived artifacts.
|
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public static FilePath.TarCompression TAR_COMPRESSION
protected transient Run<?,?> build
public StandardArtifactManager(Run<?,?> build)
public final void onLoad(Run<?,?> build)
ArtifactManager
transient
(quasi-final
) and restored here.onLoad
in class ArtifactManager
build
- a historical build with which this manager was associatedpublic void archive(FilePath workspace, Launcher launcher, BuildListener listener, Map<String,String> artifacts) throws IOException, InterruptedException
ArtifactManager
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).
archive
in class ArtifactManager
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 forkedlistener
- a way to print messages about progress or problemsartifacts
- map from paths in the archive area to paths relative to workspace
(all paths /
-separated)IOException
- if transfer or copying failed in any wayInterruptedException
- if transfer was interruptedSimpleBuildStep.perform(Run, FilePath, Launcher, TaskListener)
public final boolean delete() throws IOException, InterruptedException
ArtifactManager
delete
in class ArtifactManager
IOException
- if deletion could not be completedInterruptedException
- if deletion was interruptedpublic VirtualFile root()
ArtifactManager
root
in class ArtifactManager
Copyright © 2004–2021. All rights reserved.