What about taking the problem from the other side ?

The test fails because :
- we are trying to delete the current working directory
- doing a
FtpFile cwd = session.getFileSystemView().getWorkingDirectory();
       if(file.equals(cwd)) {
does not work on Mac OS X and Java 6 because the file handler are considered as different, just because their name are not the same - but the deletion works because behind the curtain, Mac OS X can delete the file, without taking care of the case sentivity.

It may be just a matter of checking that the file can be deleted, then check that the working directory still exists after having done the deletion. If so, we are golden, otherwise, we have to recreate it, and send an error.

In case the working directory is not empty, the deletion will fail anyway.

if we don't want to delete the working directory for some reason, we can rename it.

That should do the trick, IMO.

--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org


Reply via email to