public class DiskChecker extends Object
限定符和类型 | 类和说明 |
---|---|
static class |
DiskChecker.DiskErrorException |
static class |
DiskChecker.DiskOutOfSpaceException |
构造器和说明 |
---|
DiskChecker() |
限定符和类型 | 方法和说明 |
---|---|
static void |
checkDir(File dir)
Create the directory if it doesn't exist and
|
static void |
checkDir(LocalFileSystem localFS,
Path dir,
FsPermission expected)
Create the local directory if necessary, check permissions and also ensure
it can be read from and written into.
|
static boolean |
mkdirsWithExistsAndPermissionCheck(LocalFileSystem localFS,
Path dir,
FsPermission expected)
Create the directory or check permissions if it already exists.
|
static boolean |
mkdirsWithExistsCheck(File dir)
The semantics of mkdirsWithExistsCheck method is different from the mkdirs
method provided in the Sun's java.io.File class in the following way:
While creating the non-existent parent directories, this method checks for
the existence of those directories if the mkdir fails at any point (since
that directory might have just been created by some other process).
|
public static boolean mkdirsWithExistsCheck(File dir)
dir
- public static void checkDir(File dir) throws DiskChecker.DiskErrorException
dir
- DiskChecker.DiskErrorException
public static boolean mkdirsWithExistsAndPermissionCheck(LocalFileSystem localFS, Path dir, FsPermission expected) throws IOException
localFS
- local filesystemdir
- directory to be created or checkedexpected
- expected permissionIOException
public static void checkDir(LocalFileSystem localFS, Path dir, FsPermission expected) throws DiskChecker.DiskErrorException, IOException
localFS
- local filesystemdir
- directoryexpected
- permissionDiskChecker.DiskErrorException
IOException
Copyright © 2009 The Apache Software Foundation