FileSystemProvider.getFileSystem() handling of IOException thrown by newFileSystem()?
Vince Bonfanti
vbonfanti at gmail.com
Mon Aug 24 08:27:02 PDT 2009
On Mon, Aug 24, 2009 at 4:15 AM, Alan Bateman<Alan.Bateman at sun.com> wrote:
> 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.
>
OK. I'm overriding the default provider and in this case it seems that
my provider is expected to create the default file system
automatically (without a call to newFileSystem), which makes sense.
>> :
>>
>> 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.
>
Perfect. Thanks.
Vince
More information about the nio-discuss
mailing list