RFR 8218875: Add new FileSystems.newFileSystem methods

Langer, Christoph christoph.langer at sap.com
Wed Feb 20 13:17:47 UTC 2019

Hi Lance,

> 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)”.
> Please see my response to Roger’s similar question.
> I am not opposed to  going with Filesystems::of, just think we would need to
> do it for all of the existing methods.   It seems to add some extra bloat.  So I
> think the question is whether the extra bloat is worth it vs. the small
> compatibility issue

I can see that... If you think the source compatibility issue is neglectable, then so be it. I won't be devil's advocate there ��

But, in any case, there's one thing I'm missing: Why don't you add a FileSystems.newFileSystem(Path) method? I think that's the method that people want to call usually when they currently call FileSystems.newFileSystem(Path, (ClassLoader)null)...


More information about the nio-dev mailing list