com.michelin.cio.hudson.plugins.copytoslave
Class MyFilePath

java.lang.Object
  extended by com.michelin.cio.hudson.plugins.copytoslave.MyFilePath
All Implemented Interfaces:
java.io.Serializable

public class MyFilePath
extends java.lang.Object
implements java.io.Serializable

Complements Hudson's FilePath to enhance the copyRecursiveTo() method so that it offer a possibility to flatten dirs (cf. HUDSON-8220) and to not use Ant's default excludes (cf. HUDSON-7999).

This class also fixes HUDSON-8155.

See Also:
Serialized Form

Constructor Summary
MyFilePath()
           
 
Method Summary
static int copyRecursiveTo(hudson.FilePath source, java.lang.String fileMask, java.lang.String excludes, boolean flatten, boolean includeAntExcludes, hudson.FilePath target)
          Enhances Hudson's FilePath.copyRecursiveTo(hudson.FilePath) until I patch Hudson core and upgrade the plugin to the corresponding Hudson version.
static void readFromTar(java.lang.String name, java.io.File baseDir, boolean flatten, java.io.InputStream in)
          Full copy/paste of Hudson's FilePath.readFromTar(java.lang.String, java.io.File, java.io.InputStream) method with some tweaking (mainly the flatten behavior).
static java.lang.Integer writeToTar(java.io.File baseDir, java.lang.String fileMask, java.lang.String excludes, boolean includeAntExcludes, java.io.OutputStream out)
          Full copy/paste of Hudson's FilePath.writeToTar(java.io.File, java.lang.String, java.lang.String, java.io.OutputStream) method with some tweaking (added an includeAntExcludes parameter).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyFilePath

public MyFilePath()
Method Detail

copyRecursiveTo

public static int copyRecursiveTo(hudson.FilePath source,
                                  java.lang.String fileMask,
                                  java.lang.String excludes,
                                  boolean flatten,
                                  boolean includeAntExcludes,
                                  hudson.FilePath target)
                           throws java.io.IOException,
                                  java.lang.InterruptedException
Enhances Hudson's FilePath.copyRecursiveTo(hudson.FilePath) until I patch Hudson core and upgrade the plugin to the corresponding Hudson version.

This method supports only local to remote copy.

Throws:
java.io.IOException
java.lang.InterruptedException

readFromTar

public static void readFromTar(java.lang.String name,
                               java.io.File baseDir,
                               boolean flatten,
                               java.io.InputStream in)
                        throws java.io.IOException
Full copy/paste of Hudson's FilePath.readFromTar(java.lang.String, java.io.File, java.io.InputStream) method with some tweaking (mainly the flatten behavior).

Throws:
java.io.IOException
See Also:
FilePath.readFromTar(java.lang.String, java.io.File, java.io.InputStream)

writeToTar

public static java.lang.Integer writeToTar(java.io.File baseDir,
                                           java.lang.String fileMask,
                                           java.lang.String excludes,
                                           boolean includeAntExcludes,
                                           java.io.OutputStream out)
                                    throws java.io.IOException
Full copy/paste of Hudson's FilePath.writeToTar(java.io.File, java.lang.String, java.lang.String, java.io.OutputStream) method with some tweaking (added an includeAntExcludes parameter).

Throws:
java.io.IOException
See Also:
hudson.FilePath#writeToTar(java.lang.String, java.io.File, java.io.InputStream)


Copyright © 2010. All Rights Reserved.