Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 315841 - RemoteTools deletion of directory seems to work now only for empty directory
Summary: RemoteTools deletion of directory seems to work now only for empty directory
Status: VERIFIED FIXED
Alias: None
Product: PTP
Classification: Tools
Component: Remote Tools (show other bugs)
Version: 3.0.1   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 major (vote)
Target Milestone: 3.0.2   Edit
Assignee: Greg Watson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-04 17:02 EDT by Emmanuel Geay CLA
Modified: 2010-06-05 15:34 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Emmanuel Geay CLA 2010-06-04 17:02:32 EDT
Despite what org.eclipse.ptp.remotetools.core.IRemoteFileTools.removeDirectory documentation says it seems now the remove directory action deletes only empty directory (like a Unix rmdir does). It used to satisfy the documentation contract according to me but now trying to do so on a non-empty directory creates next exception.

org.eclipse.ptp.remotetools.exception.RemoteOperationException: 4: Failure
at org.eclipse.ptp.remotetools.internal.ssh.FileTools.removeDirectory(FileTools.java:827)
at org.eclipse.ptp.remote.remotetools.core.RemoteToolsFileStore.delete(RemoteToolsFileStore.java:149)
at ...
Caused by: 4: Failure
at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2289)
at com.jcraft.jsch.ChannelSftp.rmdir(ChannelSftp.java:1668)
at org.eclipse.ptp.remotetools.internal.ssh.FileTools$8.call(FileTools.java:819)
at org.eclipse.ptp.remotetools.internal.ssh.FileTools$8.call(FileTools.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:637)

Keeping such previous behavior is important in order to satisfy the contract of IFileStore.delete method.

PS: Such issue is seen on PTP 4, PTP 3.0.x with Eclipse Galileo and Helios.
Comment 1 Greg Watson CLA 2010-06-04 18:51:07 EDT
I've checked in a fix to 3.0 and HEAD. Please see if it fixes you problem.
Comment 2 Roland Schulz CLA 2010-06-04 19:06:21 EDT
(In reply to comment #1)
> I've checked in a fix to 3.0 and HEAD. Please see if it fixes you problem.

Sorry. This was indeed wrong. sftp rmdir is not recursive.
Comment 3 Greg Watson CLA 2010-06-04 22:58:17 EDT
Closing. Please reopen if there is a problem.
Comment 4 Emmanuel Geay CLA 2010-06-05 15:34:16 EDT
Works for me. Thanks.