7029979: (fs) Path.toRealPath(boolean) should be toRealPath(LinkOption...)

Rémi Forax forax at univ-mlv.fr
Wed Mar 23 06:26:10 PDT 2011


On 03/23/2011 01:37 PM, Alan Bateman wrote:
>
> Early versions of the file system API used a boolean parameter to 
> indicate if symbolic links should be followed or not. These methods 
> has long been changed to use LinkOption and the varargs syntax. There 
> is one remaining method in the API that still uses a boolean and I'd 
> like to get this cleaned up before the doors close on jdk7. The method 
> is Path.toRealPath where the parameter indicates if symbolic links are 
> resolved or not.  The webrev with the proposal is here:
>  http://cr.openjdk.java.net/~alanb/7029979/webrev/
>
> (Sherman - I've included an updated to the zip provider as it is 
> impacted by this change).
>
> -Alan

In my opinion, you should decouple LinkOption from the type used in 
toRealPath
to allow to specify any other options (not only link options).
I propose to introduce PathResolverOption as a supertype of LinkOption
with toRealPath declared toRealPath(PathResolverOption... options).

Rémi



More information about the nio-dev mailing list