hudson.plugins.copyartifact
Class FilePathCopyMethod

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

@Extension(ordinal=-100.0)
public class FilePathCopyMethod
extends java.lang.Object
implements CopyMethod

Default implementation of CopyMethod extension point, using Hudson's FilePath class. Has -100 ordinal value so any other plugin implementing this extension point should override this one.

Author:
Alan Harder

Nested Class Summary
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Constructor Summary
FilePathCopyMethod()
           
 
Method Summary
 int copyAll(hudson.FilePath srcDir, java.lang.String filter, hudson.FilePath targetDir)
          Copy files matching the given file mask to the specified target.
 void copyOne(hudson.FilePath source, hudson.FilePath target)
          Copy a single file.
 void init(hudson.FilePath srcDir, hudson.FilePath baseTargetDir)
          Called before copy-artifact operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilePathCopyMethod

public FilePathCopyMethod()
Method Detail

init

public void init(hudson.FilePath srcDir,
                 hudson.FilePath baseTargetDir)
          throws java.io.IOException,
                 java.lang.InterruptedException
Description copied from interface: CopyMethod
Called before copy-artifact operation.

Specified by:
init in interface CopyMethod
Parameters:
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:
java.io.IOException
java.lang.InterruptedException

copyAll

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

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

copyOne

public void copyOne(hudson.FilePath source,
                    hudson.FilePath target)
             throws java.io.IOException,
                    java.lang.InterruptedException
Description copied from interface: CopyMethod
Copy a single file.

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


Copyright © 2010. All Rights Reserved.