サブステッドドライブ (Windows 上) で呼び出すFiles.getFileStore()
と、次のエラーが発生します。
The directory is not a subdirectory of the root directory
たとえば、次のようにします。
subst P: C:\temp
ランニング:
public static void main(String[] args) throws IOException {
final Path dir = Paths.get("P:/sub");
final FileStore fileStore = Files.getFileStore(dir);
fileStore.isReadOnly();
}
結果:
Exception in thread "main" java.nio.file.FileSystemException: P:\sub: The directory is not a subdirectory of the root directory.
at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
at sun.nio.fs.WindowsFileStore.create(WindowsFileStore.java:92)
at sun.nio.fs.WindowsFileSystemProvider.getFileStore(WindowsFileSystemProvider.java:482)
at java.nio.file.Files.getFileStore(Files.java:1411)
at utils.FileStoreMain.main(FileStoreMain.java:16)
FileStore
この問題を解決し、適切なを受け取るにはどうすればよいP:
ですか?