| Constructor and Description |
|---|
FileUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
canonicalize(String path,
String separator)
Removes useless segments in relative paths, e.g.
|
static String |
changeRoot(String file,
String oldRoot,
String newRoot)
Changes the root directory of a file.
|
static void |
deleteThrowingExceptions(File... files)
Attempts to delete the provided filesand throws an
IOException in case
File.delete() returns false for any of them. |
static File |
getCanonicalOrAbsoluteFile(String path)
Creates a new
File from the provided path and attempts to execute
File.getCanonicalFile(). |
static boolean |
isFileInParent(File file,
File parent)
Returns
true if file is contained in the parent directory or any
parent of the parent directory. |
static void |
mkdirsThrowingExceptions(File dirs)
|
public static File getCanonicalOrAbsoluteFile(String path)
File from the provided path and attempts to execute
File.getCanonicalFile(). In case of a failure, returns the result
of File.getAbsoluteFile().public static String changeRoot(String file, String oldRoot, String newRoot)
public static String canonicalize(String path, String separator)
../path/../other/file.css with ../other/file.csspublic static void deleteThrowingExceptions(File... files) throws IOException
IOException in case
File.delete() returns false for any of them.IOExceptionpublic static void mkdirsThrowingExceptions(File dirs) throws IOException
IOExceptionCopyright © 2013 Carrot Search s.c.. All Rights Reserved.