Package biz.onixs.util
Class Directory
- java.lang.Object
-
- biz.onixs.util.Directory
-
public class Directory extends Object
Directory of a file system.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDirectory.FileFilterstatic classDirectory.FileNamesFile names.
-
Constructor Summary
Constructors Constructor Description Directory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancreate(String path)Creates directory for the given path.static Stringcurrent()Retrieves the current directory for the current process.static voidfindFiles(String directoryPath, String pattern, Directory.FileNames names)Returns a collection of strings naming the files in the directory denoted by the given pathname that satisfy the specified filename pattern.static booleanisDirectory(String path)Checks that the given file path represents a directory.
-
-
-
Method Detail
-
current
public static String current()
Retrieves the current directory for the current process.- Returns:
- the current directory for the current process.
-
findFiles
public static void findFiles(String directoryPath, String pattern, Directory.FileNames names)
Returns a collection of strings naming the files in the directory denoted by the given pathname that satisfy the specified filename pattern. The filename pattern can contain wildcard characters ('*' and '?'). The filename pattern can contain wildcard characters ('*' and '?').- Parameters:
directoryPath- directory pathpattern- filename patterns to be foundnames- found filenames
-
isDirectory
public static boolean isDirectory(String path)
Checks that the given file path represents a directory.- Parameters:
path- file path to be checked- Returns:
trueif and only if the file denoted by this abstract pathname exists and is a directory;falseotherwise
-
create
public static boolean create(String path)
Creates directory for the given path.- Parameters:
path- path of the directory to be created- Returns:
trueif and only if the directory was created, along with all necessary parent directories;falseotherwise
-
-