Misleading Javadoc for Path.toURI()
Alan Bateman
Alan.Bateman at oracle.com
Thu May 26 11:59:05 PDT 2011
Christian Schlichtherle wrote:
> :
>
>
>
> One thing which concerns me is that I could find no method to get to a
> Path referring to archive.jar/META-INF/MANIFEST.MF without creating a
> file system first. Any attempt resulted in an exception. Looking at
> the code, I figured this may be only an issue with the implementation
> of ZipFileSystemProvider. It also tries to mount the archive file upon
> the call to FileSystems.newFileSystem() which is redundant because I
> am not doing any I/O here. I had to add the TFile.createNewFile() and
> TFile.umount() calls just because of this.
>
A Path is associated with a FileSystem and so the FileSystem must exist.
For what you are doing, can you keep a cache of FileSystem instances to
reduce the continuous opening/closing of zip files?
I'll need to get back you on the JAR URL syntax issue. The original zip
provider used the "zip" scheme but was changed to the legacy JAR URL
syntax to provide compatibility with JarURLConnection. Unfortunately
that syntax is problematic, or will be if/when URI is updated to the
most recent RFCs.
-Alan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/nio-discuss/attachments/20110526/27a240fa/attachment.html
More information about the nio-discuss
mailing list