Legacy java.io.File and new FileSystems

Alan Bateman Alan.Bateman at oracle.com
Sun Aug 15 11:27:54 PDT 2010


Michael Hall wrote:
> :
> One further thought I had even though it may be early is that it might 
> not be quite as simple as I was thinking in that the getFileSystem 
> could simply return a nio FileSystem. The exists method includes 
> fs.getBooleanAttributes that I'm not sure is included in the nio 
> FileSystem. 
I assume you are looking at the package-private java.io.FileSystem. As I 
recall, replacing getBooleanAttributes was one of the changes. There are 
also changes to java.io.FileDescriptor that are required because the 
stream classes have constructors that take a FileDescriptor and define 
getFD methods.

> It might be needed in some cases to check for the presence of a custom 
> provider and do the toPath() route. For consistency maybe even always 
> do this taking the custom provider property as an indication that they 
> want to use the new API.
I don't think I understand what you mean but but once there is a custom 
provider set as the default then it will need to be invoked for all 
access to the file system.

-Alan.


More information about the nio-discuss mailing list