|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avalon.composition.util.FileUtils
This class provides some common file utilities used by the composition implementation, and is borrowed from the Apache Ant development team.
Constructor Summary | |
protected |
FileUtils()
Empty constructor. |
Method Summary | |
boolean |
isSymbolicLink(File parent,
String name)
Checks whether a given file is a symbolic link. |
static FileUtils |
newFileUtils()
Factory method. |
File |
normalize(String path)
"normalize" the given absolute path. |
String |
removeLeadingPath(File leading,
File path)
Removes a leading path from a second path. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected FileUtils()
Method Detail |
public static FileUtils newFileUtils()
public boolean isSymbolicLink(File parent, String name) throws IOException
It doesn't really test for symbolic links but whether the canonical and absolute paths of the file are identical - this may lead to false positives on some platforms.
parent
- the parent directory of the file to testname
- the name of the file to test.
IOException
public String removeLeadingPath(File leading, File path) throws IOException
leading
- The leading path, must not be null, must be absolute.path
- The path to remove from, must not be null, must be absolute.
IOException
public File normalize(String path) throws IOException
This includes:
File#getCanonicalPath()
it specifically doesn't
resolve symbolic links.
path
- the path to be normalized
NullPointerException
- if the file path is
equal to null.
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |