canCreate(File pPathToCreate) Returns true if specified path can be created.
public static boolean
canDelete(File pPathToDelete) Returns true if specified path can be deleted.
Parameters: pPathToDelete - file or directory to test true if path is not present or can be removed.
public static void
copyDirectory(String pFromDirectoryPath, String pToDirectoryPath) Copies contents of the from directory (excluding directory itself) to
the destination directory (again excluding directory itself).
createTempDir(String pPrefix, String pSuffix) This utility method is almost the same as File.createTempFile() method, with the only difference is
that it creates directory and not a file.
ensureNewNoFilesDirectory(String pDirectoryPath) Makes sure that the directory without files exists and accessible.
Cleans up contents of the existing directory if necessary.
listAllDirectoriesWithName(String pRootDirectoryAbsolutePath, String pNameToLookFor) Lists all directories contained in the directory and all subdirectories which
have its last name equal to the given one.
listAllFilesInDirectory(String pDirectoryAbsolutePath, FileFilter pFilter) Lists all files contained in the directory and possibly subdirectories, which are
satisfying given file filter.
trimDirectoryTree(String pTreeRootDirectoryPath) Trims tree of directories excluding specified directory.
Method Detail
canCreate
public static boolean canCreate(File pPathToCreate)(Code)
Returns true if specified path can be created.
Parameters: pPathToCreate - file or directory to test true if path is not present and can be created
canDelete
public static boolean canDelete(File pPathToDelete)(Code)
Returns true if specified path can be deleted.
Parameters: pPathToDelete - file or directory to test true if path is not present or can be removed. For directorybeing able to remove means that all it's contents are writeable including subdirectories
Copies contents of the from directory (excluding directory itself) to
the destination directory (again excluding directory itself).
Same files get overwritten
Makes sure that the clean directory exists and accessible
cleans up contents of the existing directory if necessary
ensureNewNoFilesDirectory
public static void ensureNewNoFilesDirectory(String pDirectoryPath) throws IOException(Code)
Makes sure that the directory without files exists and accessible.
Cleans up contents of the existing directory if necessary. This version
does not touch any subdirectories. Use ensureNewCleanDirectory() if you wish to
ensure that totally clean director exists.
ensureThereIsDirectory
public static void ensureThereIsDirectory(String pDirectoryPath)(Code)
Makes sure that the directory exists and accessible
creates directory if necesary
getUniqueTempDirectoryAbsolutePath
public static String getUniqueTempDirectoryAbsolutePath()(Code)
Generates the ful path for the unique temporary directory
Lists all direct child directories contained in the directory
array of strings with each element being an absolute path to the child directory of the specified directory
Lists all descendant directories (on any level) contained in the directory
array of strings with each element being an absolute path to the descendant directory of the specified directory
Lists all directories contained in the directory and all subdirectories which
have its last name equal to the given one. List is in no particular order.
Search will stop at the first match and not go any deeper. So if there is a directory
......\name\.....\name only to level directory will be returned
Parameters: pRootDirectoryAbsolutePath - the absolute path to the directory to start search from Parameters: pNameToLookFor - the name to match array of strings with each element being an absolute path to the directory matching the criteria
Lists all files contained in the directory and possibly subdirectories, which are
satisfying given file filter. Note that subdirectories will onbly be considered if file filter accepts them
array of strings with each element being an absolute path to the file contained in the directory
Lists all files contained in the directory and all subdirectories in no particular order
array of strings with each element being an absolute path to the file contained in the directory