hudson.plugins.copyartifact
Class FingerprintingCopyMethod

java.lang.Object
  extended by hudson.plugins.copyartifact.Copier
      extended by hudson.plugins.copyartifact.FingerprintingCopyMethod
All Implemented Interfaces:
hudson.ExtensionPoint, CopyMethod

@Extension(ordinal=-100.0)
public class FingerprintingCopyMethod
extends Copier

Performs fingerprinting during the copy. This minimizes the cost of the fingerprinting as the I/O bound nature of the copy operation masks the cost of digest computation.

Author:
Kohsuke Kawaguchi

Nested Class Summary
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Constructor Summary
FingerprintingCopyMethod()
           
 
Method Summary
 Copier clone()
          Creates a clone.
 int copyAll(hudson.FilePath srcDir, String filter, hudson.FilePath targetDir)
          Copy files matching the given file mask to the specified target.
 void copyOne(hudson.FilePath s, hudson.FilePath d)
          Copy a single file.
 void end()
          Ends what's started by the Copier.init(Run, AbstractBuild, FilePath, FilePath) method.
 void init(hudson.model.Run src, hudson.model.AbstractBuild<?,?> dst, hudson.FilePath srcDir, hudson.FilePath baseTargetDir)
          Called before copy-artifact operation.
 
Methods inherited from class hudson.plugins.copyartifact.Copier
from, init
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FingerprintingCopyMethod

public FingerprintingCopyMethod()
Method Detail

init

public void init(hudson.model.Run src,
                 hudson.model.AbstractBuild<?,?> dst,
                 hudson.FilePath srcDir,
                 hudson.FilePath baseTargetDir)
          throws IOException,
                 InterruptedException
Description copied from class: Copier
Called before copy-artifact operation.

Overrides:
init in class Copier
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 copy
baseTargetDir - Base target dir for upcoming file copy (the copy-artifact build step may later specify a deeper target dir)
Throws:
IOException
InterruptedException

copyAll

public int copyAll(hudson.FilePath srcDir,
                   String filter,
                   hudson.FilePath targetDir)
            throws IOException,
                   InterruptedException
Description copied from class: Copier
Copy files matching the given file mask to the specified target.

Specified by:
copyAll in interface CopyMethod
Specified by:
copyAll in class Copier
Parameters:
srcDir - Source directory
filter - Ant GLOB pattern
targetDir - Target directory
Returns:
Number of files that were copied
Throws:
IOException
InterruptedException
See Also:
FilePath.copyRecursiveTo(String,FilePath)

copyOne

public void copyOne(hudson.FilePath s,
                    hudson.FilePath d)
             throws IOException,
                    InterruptedException
Description copied from class: Copier
Copy a single file.

Specified by:
copyOne in interface CopyMethod
Specified by:
copyOne in class Copier
Parameters:
s - Source file
d - Target file (includes filename; this is not the target directory). Directory for target should already exist (copy-artifact build step calls mkdirs).
Throws:
IOException
InterruptedException
See Also:
FilePath.copyTo(FilePath)

end

public void end()
Description copied from class: Copier
Ends what's started by the Copier.init(Run, AbstractBuild, FilePath, FilePath) method.

Overrides:
end in class Copier

clone

public Copier clone()
Description copied from class: Copier
Creates a clone. This method is only called before the Copier.init(Run, AbstractBuild, FilePath, FilePath) method to allow each init-end session to run against different objects, so you need not copy any state that your Copier might maintain. This is a cheap hack to implement a factory withot breaking backward compatibility. If you maintain no state, this method can return this without creating a copy.

Specified by:
clone in class Copier


Copyright © 2004-2012 Hudson. All Rights Reserved.