org.tromer.jie
Class FileTransformer

java.lang.Object
  |
  +--org.tromer.jie.FileTransformer
Direct Known Subclasses:
InstrumentingFileTransformer

public class FileTransformer
extends java.lang.Object

Makes a complete copy of a directory tree, while transforming the files along the way. The default implementation does a simple copy, override transformStream to change this.


Constructor Summary
FileTransformer()
           
 
Method Summary
protected  boolean isFileAccepted(java.io.File file)
          Applies a filter to the files that will be handled by transformDirectory().
 void transform(java.io.File src, java.io.File dest)
          Transform either a single file or a directory, depending on what srcFile really is.
 void transformDirectory(java.io.File srcRoot, java.io.File destRoot)
          Transform a complete directory.
 void transformFile(java.io.File src, java.io.File dest)
          Transform a single file.
 void transformStream(java.io.InputStream srcStream, java.io.OutputStream destStream)
          Actual transformation, from InputStream to OutputStream.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileTransformer

public FileTransformer()
Method Detail

transform

public void transform(java.io.File src,
                      java.io.File dest)
               throws java.io.IOException
Transform either a single file or a directory, depending on what srcFile really is.

transformDirectory

public void transformDirectory(java.io.File srcRoot,
                               java.io.File destRoot)
                        throws java.io.IOException
Transform a complete directory.

transformFile

public void transformFile(java.io.File src,
                          java.io.File dest)
                   throws java.io.IOException
Transform a single file.

transformStream

public void transformStream(java.io.InputStream srcStream,
                            java.io.OutputStream destStream)
                     throws java.io.IOException
Actual transformation, from InputStream to OutputStream. Default implementation: plain copy.

isFileAccepted

protected boolean isFileAccepted(java.io.File file)
Applies a filter to the files that will be handled by transformDirectory(). By default, all files.