|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.rhq.core.pluginapi.util.FileUtils
public abstract class FileUtils
A set of utilities for working with files and file paths.
Method Summary | |
---|---|
static String |
findString(String filePath,
String stringToFind)
|
static String |
getCanonicalPath(String path)
Canonicalize the specified file path according to the current platform's rules: Condense multiple consecutive path separators into a single path separator. |
static void |
purge(File dir,
boolean deleteIt)
The purpose of this method is to purge a directory of all of its contents, but it can also be used to simply delete a given file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void purge(File dir, boolean deleteIt)
dir
is a directory, this method will
attempt to delete all of its files and all of its subdirectories and their child files/subdirectories.
dir
itself will then be deleted, but only if deleteIt
is true
.
If dir
is not a directory, but rather a simple file, it will be deleted only if
deleteIt
is true
.
If dir
is null
, this method does nothing.
dir
- the directory to purge (may also be just a simple file)deleteIt
- if true
, file
will be deleted after all of its contents are
deletedpublic static String findString(String filePath, String stringToFind) throws IOException
IOException
public static String getCanonicalPath(String path)
File.getCanonicalPath()
, this method does not resolve symlinks.
The path may or may not reference an existing file.
path
- the file path to be canonicalized
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |