org.objectweb.jac.util
Class File

java.lang.Object
  extended byjava.io.File
      extended byorg.objectweb.jac.util.File
All Implemented Interfaces:
Comparable, Serializable

public class File
extends File

Provides recursive file listing, and replaces leading ~ by the user's home directory.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar
 
Constructor Summary
File(File file)
           
File(File parent, String child)
           
File(File parent, String child)
           
File(String pathname)
           
File(String parent, String child)
           
 
Method Summary
 String getRelativePath(File parent)
          Gets a path relative to a parent directory of the file.
 File[] listDirectories()
           
 List listFilesRecursively(FilenameFilter filter)
          Recursively list files matching a filter
 void listFilesRecursively(FilenameFilter filter, List files)
          Recursively list files matching a filter
 File[] listNonHiddenFiles()
           
 
Methods inherited from class java.io.File
canRead, canWrite, compareTo, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getName, getParent, getParentFile, getPath, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setLastModified, setReadOnly, toString, toURI, toURL
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

File

public File(File file)

File

public File(String pathname)

File

public File(File parent,
            String child)

File

public File(File parent,
            String child)

File

public File(String parent,
            String child)
Method Detail

listFilesRecursively

public List listFilesRecursively(FilenameFilter filter)
Recursively list files matching a filter

Parameters:
filter - list files matching this filter
Returns:
a List of File matching the filter
See Also:
listFilesRecursively(FilenameFilter,List)

listFilesRecursively

public void listFilesRecursively(FilenameFilter filter,
                                 List files)
Recursively list files matching a filter

Parameters:
filter - list files matching this filter
files - add matching files to this list
See Also:
listFilesRecursively(FilenameFilter)

getRelativePath

public String getRelativePath(File parent)
                       throws IOException
Gets a path relative to a parent directory of the file.

Parameters:
parent - the directory to give a path relative to
Returns:
a path relative to parent, or getPath() if parent is not a parent of the file.
Throws:
IOException

listDirectories

public File[] listDirectories()

listNonHiddenFiles

public File[] listNonHiddenFiles()