public class FileSystems extends Object
| 构造器和说明 |
|---|
FileSystems() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
hasFreeSpace(File path,
long size)
Checks if the request number of bytes of free disk space are available under the given
path.
|
static boolean |
isHidden(File file) |
static boolean |
isNotSymlink(File file)
Determines whether the specified file is a Symbolic Link rather than an actual file.
|
static boolean |
isSymlink(File file) |
public static boolean hasFreeSpace(File path, long size)
path - Directory to checksize - Bytes of free space requestedpublic static boolean isHidden(File file)
public static boolean isNotSymlink(File file) throws IOException
Will not return true if there is a Symbolic Link anywhere in the path, only if the specific file is.
When using jdk1.7, this method delegates to boolean java.nio.file.Files.isSymbolicLink(Path path)
Note: the current implementation always returns false if running on jdk1.6
For code that runs on Java 1.7 or later, use the following method instead:
boolean java.nio.file.Files.isSymbolicLink(Path path)
file - the file to checkIOException - if an IO error occurs while checking the filepublic static boolean isSymlink(File file) throws IOException
IOExceptionCopyright © 2021. All rights reserved.