Package hudson.plugins.copyartifact
Class Copier
- java.lang.Object
-
- hudson.plugins.copyartifact.Copier
-
- All Implemented Interfaces:
ExtensionPoint
- Direct Known Subclasses:
FilePathCopyMethod
,FingerprintingCopyMethod
@Deprecated public abstract class Copier extends Object implements ExtensionPoint
Deprecated.No longer used.Extension point for how files are copied. CopyArtifact plugin provides a default implementation using methods available in the Jenkins FilePath class.A copier instance
- Author:
- Alan Harder, Kohsuke Kawaguchi
- See Also:
- "JENKINS-7753"
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description Copier()
Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract Copier
clone()
Deprecated.Creates a clone.int
copyAll(FilePath srcDir, String filter, FilePath targetDir)
Deprecated.int
copyAll(FilePath srcDir, String filter, FilePath targetDir, boolean fingerprintArtifacts)
Deprecated.call/overridecopyAll(FilePath, String, String, FilePath, boolean)
instead.int
copyAll(FilePath srcDir, String filter, String excludes, FilePath targetDir, boolean fingerprintArtifacts)
Deprecated.Copy files matching the given file mask to the specified target.void
copyOne(FilePath source, FilePath target)
Deprecated.call/overridecopyOne(FilePath source, FilePath target, boolean fingerprintArtifacts)
instead.abstract void
copyOne(FilePath source, FilePath target, boolean fingerprintArtifacts)
Deprecated.Copy a single file.void
end()
Deprecated.Ends what's started by theinit(Run, AbstractBuild, FilePath, FilePath)
method.void
init(Run src, AbstractBuild<?,?> dst, FilePath srcDir, FilePath baseTargetDir)
Deprecated.void
initialize(Run<?,?> src, Run<?,?> dst, FilePath srcDir, FilePath baseTargetDir)
Deprecated.Called before copy-artifact operation.
-
-
-
Method Detail
-
initialize
public void initialize(Run<?,?> src, Run<?,?> dst, FilePath srcDir, FilePath baseTargetDir) throws IOException, InterruptedException
Deprecated.Called before copy-artifact operation.- Parameters:
src
- The build record from which we are copying artifacts.dst
- The built into which we are copying artifacts.srcDir
- Source for upcoming file copybaseTargetDir
- Base target dir for upcoming file copy (the copy-artifact build step may later specify a deeper target dir)- Throws:
IOException
- if an error occurs while performing the operation.InterruptedException
- if any thread interrupts the current thread.- Since:
- TODO ?
-
init
@Deprecated public void init(Run src, AbstractBuild<?,?> dst, FilePath srcDir, FilePath baseTargetDir) throws IOException, InterruptedException
Deprecated.Called before copy-artifact operation.- Parameters:
src
- The build record from which we are copying artifacts.dst
- The built into which we are copying artifacts.srcDir
- Source for upcoming file copybaseTargetDir
- Base target dir for upcoming file copy (the copy-artifact build step may later specify a deeper target dir)- Throws:
IOException
- if an error occurs while performing the operation.InterruptedException
- if any thread interrupts the current thread.
-
copyAll
@Deprecated public int copyAll(FilePath srcDir, String filter, FilePath targetDir) throws IOException, InterruptedException
Deprecated.Copy files matching the given file mask to the specified target.- Parameters:
srcDir
- Source directoryfilter
- Ant GLOB patterntargetDir
- Target directory- Returns:
- Number of files that were copied
- Throws:
IOException
- if an error occurs while performing the operation.InterruptedException
- if any thread interrupts the current thread.
-
copyAll
@Deprecated public int copyAll(FilePath srcDir, String filter, FilePath targetDir, boolean fingerprintArtifacts) throws IOException, InterruptedException
Deprecated.call/overridecopyAll(FilePath, String, String, FilePath, boolean)
instead.Copy files matching the given file mask to the specified target.- Parameters:
srcDir
- Source directoryfilter
- Ant GLOB patterntargetDir
- Target directoryfingerprintArtifacts
- boolean controlling if the copy should also fingerprint the artifacts- Returns:
- Number of files that were copied
- Throws:
IOException
- if an error occurs while performing the operation.InterruptedException
- if any thread interrupts the current thread.
-
copyAll
public int copyAll(FilePath srcDir, String filter, String excludes, FilePath targetDir, boolean fingerprintArtifacts) throws IOException, InterruptedException
Deprecated.Copy files matching the given file mask to the specified target. You must override this when derivingCopier
.- Parameters:
srcDir
- Source directoryfilter
- Ant GLOB patternexcludes
- Ant GLOB pattern. Can be null.targetDir
- Target directoryfingerprintArtifacts
- boolean controlling if the copy should also fingerprint the artifacts- Returns:
- Number of files that were copied
- Throws:
IOException
- if an error occurs while performing the operation.InterruptedException
- if any thread interrupts the current thread.- See Also:
FilePath.copyRecursiveTo(String,FilePath)
-
copyOne
@Deprecated public void copyOne(FilePath source, FilePath target) throws IOException, InterruptedException
Deprecated.call/overridecopyOne(FilePath source, FilePath target, boolean fingerprintArtifacts)
instead.Copy a single file.- Parameters:
source
- Source filetarget
- Target file (includes filename; this is not the target directory). Directory for target should already exist (copy-artifact build step calls mkdirs).- Throws:
IOException
- if an error occurs while performing the operation.InterruptedException
- if any thread interrupts the current thread.
-
copyOne
public abstract void copyOne(FilePath source, FilePath target, boolean fingerprintArtifacts) throws IOException, InterruptedException
Deprecated.Copy a single file.- Parameters:
source
- Source filetarget
- Target file (includes filename; this is not the target directory). Directory for target should already exist (copy-artifact build step calls mkdirs).fingerprintArtifacts
- boolean controlling if the copy should also fingerprint the artifacts- Throws:
IOException
- if an error occurs while performing the operation.InterruptedException
- if any thread interrupts the current thread.- See Also:
FilePath.copyTo(FilePath)
-
end
public void end() throws IOException, InternalError
Deprecated.Ends what's started by theinit(Run, AbstractBuild, FilePath, FilePath)
method.- Throws:
IOException
- if an error occurs while performing the operation.InternalError
-
clone
public abstract Copier clone()
Deprecated.Creates a clone. This method is only called before theinit(Run, AbstractBuild, FilePath, FilePath)
method to allow each initialize-end session to run against different objects, so you need not copy any state that yourCopier
might maintain. This is a cheap hack to implement a factory withot breaking backward compatibility. If you maintain no state, this method can returnthis
without creating a copy.
-
-