org.knopflerfish.framework
Class FileTree

java.lang.Object
  extended by java.io.File
      extended by org.knopflerfish.framework.FileTree
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<java.io.File>

public class FileTree
extends java.io.File

FileTree is extension to java.io.File that handles copying and deletion of complete file structures.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar
 
Constructor Summary
FileTree(java.io.File file, java.lang.String name)
          Creates a new Filetree instance by a pathname string to an existing File or FileTree.
FileTree(java.lang.String name)
          Creates a new FileTree instance based on given pathname string.
FileTree(java.lang.String n1, java.lang.String n2)
          Creates a new FileTree instance from a parent pathname string and a child pathname string.
 
Method Summary
 void copyTo(java.io.File copyFile)
          Copy this file tree to specified destination.
 boolean delete()
          Delete this file tree from disk.
 
Methods inherited from class java.io.File
canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toString, toURI, toURL
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileTree

public FileTree(java.lang.String name)
Creates a new FileTree instance based on given pathname string.


FileTree

public FileTree(java.io.File file,
                java.lang.String name)
Creates a new Filetree instance by a pathname string to an existing File or FileTree.


FileTree

public FileTree(java.lang.String n1,
                java.lang.String n2)
Creates a new FileTree instance from a parent pathname string and a child pathname string.

Method Detail

copyTo

public void copyTo(java.io.File copyFile)
            throws java.io.IOException
Copy this file tree to specified destination.

Parameters:
copyFile - File object representing the destination.
Throws:
java.io.IOException - if copy failed. Will leave destination in an unspecified state.

delete

public boolean delete()
Delete this file tree from disk.

Overrides:
delete in class java.io.File
Returns:
True if operation completed okay.