AW: Legacy java.io.File and new FileSystems
Alan Bateman
Alan.Bateman at oracle.com
Tue Aug 17 05:19:26 PDT 2010
Christian Schlichtherle wrote:
> Hi Alan,
>
> following this discussion, I am a bit confused.
>
> What Michael and me are hoping for is the ability to replace the default
> FileSystemProvider at runtime in a way which is completely transparent for
> the rest of (legacy) applications.
I understand. The issue is simply that the current implementation
doesn't redirect when the default provider is set. Sorry about that, it
just wasn't ready at the time. At this point it's best to just consider
it a bug or a left-over task. I cannot say which build it will be fixed
in. As always, the alternative is to contribute [1] the changes on nio-dev.
> :
>
> etc. would allow an application to access archive files transparently. If
> the support is complete, it should even be possible to use JFileChooser
> (without implementing FileSystemView) and browse archive files much like
> Windows Explorer browses ZIP files today.
>
There are other areas in the platform that access the file system
directly so they will be problematic. I think I mentioned java.util.zip
in one of the posts as that's a good example where it opens the zip file
directly, and depending on platform, mmaps the central directory into
memory. I'm a bit hazy on JFileChooser but I believe its default
FileSystemView makes use of the platform's shell API/equivalent. You may
want to bring that one up on the swing-dev mailing list.
-Alan
[1] http://openjdk.java.net/contribute/
More information about the nio-discuss
mailing list