Announce: JSR 202 resources, call for contributions/help

Alan Bateman Alan.Bateman at oracle.com
Wed Dec 17 09:04:31 UTC 2014


On 16/12/2014 22:36, Francis Galiegue wrote:
> Hello,
>
> I am, myself, a convinced user of java.nio.file; in new code, when I
> can "afford" Java 7+, File is dead, it is as simple as that.
One thing to say on this is that we deliberately did not deprecate 
java.io.File. It has lots of unfixable issues but it wasn't toxic enough 
to be deprecated. Instead we focused on making it easy for File and the 
new API to be used together and allow code migrate over time. Also 
you'll see that the File javadoc has several references to the new API, 
the motive being to point readers as methods that will often do the 
right thing.

I have not looked at usage in some time but initially the challenge was 
libraries and applications that were targeting >= JDK 6 and so could not 
use the new API.

Thanks for your efforts to promote the API.


> :
>
> And I also have this: https://github.com/java7-fs-more; its goal is to
> provide path resolution methods, recursive copy/deletion methods etc,
> making it even easier to use the new API.
>
>
I get a 404 for this link but I would be interested in your experiences 
or feedback you get on these. We've prototyped providing recursive 
versions of the common operations several times but never came to a 
conclusion on the best way to deal with errors (too many approaches).

If you are interested then the samples that ship with the JDK include 
several that do recursive operations. In sample/nio/file/Copy.java then 
you'll find a tool that is roughly cp [-R -p -i]. Another one is 
Chmod.java that is roughly chmod [-R]. In both cases then the error 
handling roughly matches the equivalent command line tool.

-Alan.


More information about the nio-dev mailing list