8154077: (fs) Reduce number of file system classes loaded during startup

Reviewed-by: bpb, chegar
This commit is contained in:
Alan Bateman 2016-04-13 14:29:25 +01:00
parent 87c6cee72e
commit 33a3b1cdf0
9 changed files with 156 additions and 8 deletions

View file

@ -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.
*/