Re: [14] 8223151: Document whether FileSystemProvider.newFileSystem​(Path, Map) always returns new FileSystem objects

Alan Bateman Alan.Bateman at oracle.com
Sun Jun 16 06:57:43 UTC 2019


On 13/06/2019 19:15, Lance Andersen wrote:
> No, it is slightly different.
The underlying bug here is that the zip file system provider's 
newFileSystem(Path, Map) is throwing FileSystemAlreadyExistsException 
whereas it is supposed to create a new file system each time. There are 
questions in the issue for the scenario where the same file is open 
several times to create different file systems which leads to several 
provider specific questions on whether the zip file is locked or whether 
there is any other coordination between the different instances.

There is scope for additional javadoc, maybe in the FileSystems factory 
class or in FileSystemProvider to outline how providers that identify a 
file system via a URI should work. This will lead to discussion on 
Path.of(URI) and the observation that it is file system provider 
specific as to whether it creates a file system or returns a Path to a 
file in an existing file system. The zip file system provider was 
intended to support the latter approach for cases where the zip file 
system is created with a URI.

-Alan


More information about the nio-dev mailing list