1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 23:25:26 +02:00

Throw RemoteFileCanceledException in case IFileService#getFile() was canceled

This commit is contained in:
Martin Oberhuber 2007-07-27 17:20:16 +00:00
parent 17795ab579
commit 027ca1461a
2 changed files with 5 additions and 6 deletions

View file

@ -54,6 +54,7 @@ import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
import org.eclipse.rse.services.files.AbstractFileService;
import org.eclipse.rse.services.files.IFileService;
import org.eclipse.rse.services.files.IHostFile;
import org.eclipse.rse.services.files.RemoteFileCancelledException;
import org.eclipse.rse.services.files.RemoteFileIOException;
import org.eclipse.rse.services.files.RemoteFileSecurityException;
@ -248,7 +249,6 @@ public class SftpFileService extends AbstractFileService implements IFileService
//getFile() must return a dummy even for non-existent files,
//or the move() operation will fail. This is described in
//the API docs.
//TODO when monitor is canceled, it is unclear whether we should return an empty file node or throw a canceled exception.
SftpHostFile node = null;
SftpATTRS attrs = null;
if (fDirChannelMutex.waitForLock(monitor, fDirChannelTimeout)) {
@ -267,6 +267,8 @@ public class SftpFileService extends AbstractFileService implements IFileService
} finally {
fDirChannelMutex.release();
}
} else {
throw new RemoteFileCancelledException();
}
if (node==null) {
node = new SftpHostFile(remoteParent, fileName, false, false, false, 0, 0);

View file

@ -22,11 +22,8 @@ import org.eclipse.rse.services.clientserver.messages.SystemMessage;
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
/**
* Exception thrown when attempting an operation and it fails for IO reasons, such as
* the file is read-only.
* <p>
* The original remote system's io message is always embedded and retrievable
* via getRemoteException().
* Exception thrown when attempting a file operation and the user
* canceled it before it could be completed.
*/
public class RemoteFileCancelledException extends RemoteFileIOException {