On 31/05/2018 09:26, Paolo Di Tommaso wrote:
The NIO api can be very annoying.
Hover I think here the problem is that Paths.get(<string path>) is
designed to only return default file (local) system path objects.
Instead Paths.get(<URI>) allows the automatic creation of a new file
system as stated by the documentation
<https://docs.oracle.com/javase/7/docs/api/java/nio/file/Paths.html#get%28java.net.URI%29>.
/Throws /
/FileSystemNotFoundException - The file system, identified by the
URI, does not exist and cannot be created *automatically*, or the
provider identified by the URI's scheme component is not installed/
However is role of FileSystemProvider implementation to automatically
create a new file system if does not exist and, I think, the
ZipFileSystemProvider is not doing that.
You are correct. It is my typo in the code and a common mistake that is
made. The code should read:
Paths.get('gz:/path/to/compressed.gz'.toURI())
--
Schalk W. Cronjé
Twitter / Ello / Toeter : @ysb33r