| java.lang.Object com.sun.jbi.management.internal.support.DirectoryUtil
DirectoryUtil | public class DirectoryUtil (Code) | | Provides utility methods for common file system tasks.
author: Sun Microsystems, Inc. |
Method Summary | |
public static void | deleteDir(String dirName) Deletes directory including the sub directories. | public static String[] | getFolderNameListing(File aDir) Util method to get the list of folders.
Parameters: aDir - folder name for which contents have to be listed. | public static boolean | isMarked(File dir) Determies if a given directory has been marked for deletion. | public static File[] | listFiles(File root, Pattern prefix) Returns a list of files within the specified directory that start with
the specified prefix. | public static void | markDir(String dirName) | public static boolean | removeDir(String dirName) Complements deleteDir, but provides a more comprehensive contract
for removal of a directory. | public static void | removeMarkedDirs(String root) Finds all marked child directories of parent and deletes them. |
DELETE_ME_FILE | final static String DELETE_ME_FILE(Code) | | file that gets created when a directory is not successfully removed
|
deleteDir | public static void deleteDir(String dirName) throws Exception(Code) | | Deletes directory including the sub directories.
Parameters: dirName - Name of the directory to delete throws: Exception - If failed to delete directory |
getFolderNameListing | public static String[] getFolderNameListing(File aDir)(Code) | | Util method to get the list of folders.
Parameters: aDir - folder name for which contents have to be listed. array of folder names. |
isMarked | public static boolean isMarked(File dir)(Code) | | Determies if a given directory has been marked for deletion.
|
listFiles | public static File[] listFiles(File root, Pattern prefix)(Code) | | Returns a list of files within the specified directory that start with
the specified prefix.
|
markDir | public static void markDir(String dirName)(Code) | | Mark a directory for deletion by adding a .DELETE_ME file
|
removeDir | public static boolean removeDir(String dirName)(Code) | | Complements deleteDir, but provides a more comprehensive contract
for removal of a directory. If the deletion fails at any stage
(parent or child), the top-level directory is marked for deletion
at a subsequent time with a .DELETE_ME file.
|
removeMarkedDirs | public static void removeMarkedDirs(String root)(Code) | | Finds all marked child directories of parent and deletes them.
|
|
|