bu in Path.Relativize

Rémi Forax forax at univ-mlv.fr
Wed Feb 10 08:44:03 PST 2010


Le 10/02/2010 17:39, Alan Bateman a écrit :
> Rémi Forax wrote:
>> It seems that relativize doesn't understand well the concept of 
>> current directory (".").
>>
>>     Path path1 = Paths.get("foo.txt");
>>     Path path2 = Paths.get(".");
>>
>>     Path relativize = path2.relativize(path1);
>>     System.out.println(relativize);   // print ../foo.txt
>>
>> I use jdk7 b81 under linux,
>> Rémi
> You're right - I'll create a bug for this now. Thanks Rémi! 

Thank you, Alan,
a workaround is to used realPath() on both paths before calling relativize.

Rémi


More information about the nio-dev mailing list