RFR 8218875: Add new FileSystems.newFileSystem methods

Langer, Christoph christoph.langer at sap.com
Wed Feb 20 10:23:23 UTC 2019

Hi Lance,

first of all, thanks for taking this. I also lately wondered about why there wasn’t the same set of newFileSystem methods in FileSystems that would take a Path compared to those that work on a URI. I was about to ask this on the mailing list.

It’s really too bad that there is this method with signature newFileSystem​(Path path, ClassLoader loader) when it rather should have been newFileSystem​(Path path, Map<String,​?> env, ClassLoader loader) to mirror the API using the URI.

I think we should not become source incompatible. So what about spending a set of 3 methods that are named FileSystems::of that take a Path? And in any case, deprecate “newFileSystem​(Path path, ClassLoader loader)”.

I assume you’ll open a CSR for that change once it’s a bit clearer on where we’re going with it?


From: nio-dev <nio-dev-bounces at openjdk.java.net> On Behalf Of Roger Riggs
Sent: Dienstag, 19. Februar 2019 22:15
To: nio-dev at openjdk.java.net
Subject: Re: RFR 8218875: Add new FileSystems.newFileSystem methods

Hi Lance,

Did you consider alternative method names or signatures that would avoid
the ambiguity and the necessity of ugly/hacky casts of (ClassLoader)null)?

Perhaps adding a method that has only Path and assumes a null classloader?

??, Roger

On 2/19/19 3:54 PM, Lance Andersen wrote:
Hi all,

Please review the update to Filesystems which adds  the methods:

              newFileSystem(Path, Map<String,?>) and newFileSystem(Path, Map<String,?>, ClassLoader).

These methods are being added to provide better support for working with  the Zip File System.

The webrev can be found at:  http://cr.openjdk.java.net/~lancea/8218875/webrev.00/index.html

[cid:image001.gif at 01D4C90D.BE12FBE0]<http://oracle.com/us/design/oracle-email-sig-198324.gif>

<http://oracle.com/us/design/oracle-email-sig-198324.gif>Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering
1 Network Drive
Burlington, MA 01803
Lance.Andersen at oracle.com<mailto:Lance.Andersen at oracle.com>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20190220/560d0a16/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 658 bytes
Desc: image001.gif
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20190220/560d0a16/image001.gif>

More information about the nio-dev mailing list