2009/3/6 Emmanuel Lecharny <[email protected]>
> Sai Pullabhotla wrote:
>
>> That's what I was expecting. So, if the issue is about RMDIR on the
>> current
>> working directory, we should be able to match up the canonical paths and
>> if
>> they are same (the directory that was requested for deletion and the
>> current
>> working directory), send an error back. Does that sound correct?
>>
>>
> :)
>
> Ok, I have changed the RMDIR impl, and now, all the tests are passing.
> Following Sai's suggestion, here is what I have :
>
> instead of :
>
> if(file.equals(cwd)) { blah
>
> I now have :
>
> File cwdFile = ((NativeFtpFile)cwd).getPhysicalFile();
> File currentFile = ((NativeFtpFile)file).getPhysicalFile();
>
> if (cwdFile.getCanonicalPath().equals(currentFile.getCanonicalPath())) {
> blah
>
>
> and it works on mac.
>
> Could someone do the test on W$ and Linux ?
>
After changing NativeFtpFile equals to the followingcode :
@Override
public boolean equals(Object obj) {
try{
if(obj != null && obj instanceof NativeFtpFile) {
return this.file.getCanonicalPath().equals( ((NativeFtpFile)
obj).file.getCanonicalPath() ) ;
}
}catch(IOException e){}
return false;
}
All the tests are passing under Windows (Vista) with Jre 1.6.0_7 and Jre
1.5.0_15
>
> Thanks for the heads up, Sai !
>
> --
> --
> cordialement, regards,
> Emmanuel Lécharny
> www.iktek.com
> directory.apache.org
>
>
>