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

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

public class MyFilePath
extends Object
implements 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, String includes, 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(File baseDir, boolean flatten, 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 Integer writeToTar(File baseDir, String includes, String excludes, boolean includeAntExcludes, 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,
                                  String includes,
                                  String excludes,
                                  boolean flatten,
                                  boolean includeAntExcludes,
                                  hudson.FilePath target)
                           throws IOException,
                                  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 local and local to remote copies.

Throws:
IOException
InterruptedException

readFromTar

public static void readFromTar(File baseDir,
                               boolean flatten,
                               InputStream in)
                        throws 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:
IOException
See Also:
FilePath.readFromTar(java.lang.String, java.io.File, java.io.InputStream)

writeToTar

public static Integer writeToTar(File baseDir,
                                 String includes,
                                 String excludes,
                                 boolean includeAntExcludes,
                                 OutputStream out)
                          throws 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:
IOException
See Also:
hudson.FilePath#writeToTar(java.lang.String, java.io.File, java.io.InputStream)


Copyright © 2004-2012 Hudson. All Rights Reserved.