org.objectweb.jac.util
Class File
java.lang.Object
java.io.File
org.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
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 |
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)
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 filterfiles
- 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()