More NIO feedback

John Hendrikx hjohn at xs4all.nl
Fri Oct 30 19:56:12 PDT 2009


As I'm working with NIO2 pretty extensively, here's some more feedback 
on the framework:

1) Other than parsing exception message text, there's no way to 
distinguish a "disk full" condition and other FileSystemExceptions.  
Disk Full conditions are something a user can solve in the background 
allowing the offending operation to be retried and so I would like to 
inform the user of this condition in a more specific way.

2) Will there be any new way of obtaining an icon for a Path?  It is a 
kind of Attribute.  Currently obtaining these involves using 
javax.swing.filechooser.FileSystemView.  This works well for Windows.  
For Linux however it is very bland, resulting in the need to customize 
this.  Files.probeContentType's mimetype is already a big help for doing 
this manually though.

3) I was having some trouble automagically handling retries of 
operations that throw AccessDeniedException.  For example, Path.delete() 
can throw this, and what I'm trying to achieve is to see if the 
Attributes can be altered in such a way (with the current privileges) 
that would result in the delete succeeding (a "forced" delete).

This is somewhat harder than I expected, although not impossible.  I'm 
writing a static class to handle these nasty details.

4) Related to 3, I'm wondering if there's any way Java could temporarily 
get higher privileges (like obtaining root privileges by prompting for a 
password).  Is such a thing possible at all?

5) Is there any way to obtain FileStore specific parameters, like:
- case sensitivity
- limitations (max name length, max file size)
- charset
- soft/hard link support available
- sparse file creation

Thanks
--John








More information about the nio-dev mailing list