Why does Path check for the Default FileSystem?
Michael Hall
mik3hall at gmail.com
Tue Mar 23 13:36:55 UTC 2021
May I ask why the default FileSystem is checked for here?
default File toFile() {
if (getFileSystem() == FileSystems.getDefault()) {
return new File(toString());
} else {
throw new UnsupportedOperationException("Path not associated with "
+ "default file system.");
}
}
For my custom DefaultFileSystemProvider I found it necessary to have my own Path class.
Most of mine is passthrough and for the Path class I keep a proxy platform provider Path that I use for almost all functionality.
This check now seems to fail this?
Is it necessary to be the default or would also being for the default ‘file’ scheme be good enough?
More information about the nio-dev
mailing list