mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8154077: (fs) Reduce number of file system classes loaded during startup
Reviewed-by: bpb, chegar
This commit is contained in:
parent
87c6cee72e
commit
33a3b1cdf0
9 changed files with 156 additions and 8 deletions
|
@ -499,6 +499,29 @@ public abstract class UnixFileSystemProvider
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean isDirectory(Path obj) {
|
||||
UnixPath file = UnixPath.toUnixPath(obj);
|
||||
file.checkRead();
|
||||
int mode = UnixNativeDispatcher.stat(file);
|
||||
return ((mode & UnixConstants.S_IFMT) == UnixConstants.S_IFDIR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean isRegularFile(Path obj) {
|
||||
UnixPath file = UnixPath.toUnixPath(obj);
|
||||
file.checkRead();
|
||||
int mode = UnixNativeDispatcher.stat(file);
|
||||
return ((mode & UnixConstants.S_IFMT) == UnixConstants.S_IFREG);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean exists(Path obj) {
|
||||
UnixPath file = UnixPath.toUnixPath(obj);
|
||||
file.checkRead();
|
||||
return UnixNativeDispatcher.exists(file);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a {@code FileTypeDetector} for this platform.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue