FileSystemProvider.getFileSystem() handling of IOException thrown by newFileSystem()?

Alan Bateman Alan.Bateman at Sun.COM
Mon Aug 24 01:15:31 PDT 2009


Vince Bonfanti wrote:
> The JavaDocs for java.nio.file.spi.FileSystemProvider
> (http://java.sun.com/javase/7/docs/api/java/nio/file/spi/FileSystemProvider.html)
> make it clear that getFileSystem() is supposed to invoke
> newFileSystem() to create a new FileSystem instance,
>   
The intention is that getFileSystem returns a reference to an existing 
FileSystem (that was created previously by calling the provider's 
newFileSystem method). So getFileSystem doesn't create a FileSystem - 
instead it throws the unchecked FileSystemNotFoundException if it does 
not exist. I think we improve the wording of the method description to 
make this clearer.

> :
>
> Is there any documentation available for authors of file system
> providers other than the JavaDocs and resources listed on the project
> web site (http://openjdk.java.net/projects/nio/)?
>   
We don't, but if you keep notes on the issues you run into then perhaps 
we could add a page to aid future provider implementers. In the demo 
directory you'll find a prototype of a zip provider (written by Rajendra 
Gutupalli) that might be useful.

-Alan.


More information about the nio-discuss mailing list