mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-13 20:15:22 +02:00
Fix error message in case of canceled ssh transfer
This commit is contained in:
parent
992747ac6a
commit
ce3c3c4ca9
1 changed files with 31 additions and 24 deletions
|
@ -252,6 +252,10 @@ public class SftpFileService extends AbstractFileService implements IFileService
|
|||
channel=(ChannelSftp)fSessionProvider.getSession().openChannel("sftp"); //$NON-NLS-1$
|
||||
channel.connect();
|
||||
channel.put(localFile.getAbsolutePath(), dst, sftpMonitor, mode); //$NON-NLS-1$
|
||||
Activator.trace("SftpFileService.upload "+remoteFile+ " ok"); //$NON-NLS-1$ //$NON-NLS-1$
|
||||
if (monitor.isCanceled()) {
|
||||
return false;
|
||||
} else {
|
||||
SftpATTRS attr = channel.stat(dst);
|
||||
attr.setACMODTIME(attr.getATime(), (int)(localFile.lastModified()/1000));
|
||||
////TODO check if we want to maintain permissions
|
||||
|
@ -265,7 +269,7 @@ public class SftpFileService extends AbstractFileService implements IFileService
|
|||
System.err.println("ssh.upload: file size mismatch for "+dst);
|
||||
return false;
|
||||
}
|
||||
Activator.trace("SftpFileService.upload "+remoteFile+ " ok"); //$NON-NLS-1$ //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
//TODO See download
|
||||
|
@ -350,6 +354,10 @@ public class SftpFileService extends AbstractFileService implements IFileService
|
|||
channel=(ChannelSftp)fSessionProvider.getSession().openChannel("sftp"); //$NON-NLS-1$
|
||||
channel.connect();
|
||||
channel.get(remotePath, localFile.getAbsolutePath(), sftpMonitor, mode); //$NON-NLS-1$
|
||||
Activator.trace("SftpFileService.download "+remoteFile+ " ok"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
if (monitor.isCanceled()) {
|
||||
return false;
|
||||
} else {
|
||||
SftpATTRS attr = channel.stat(remotePath);
|
||||
localFile.setLastModified(1000L * attr.getMTime());
|
||||
//TODO should we set the read-only status?
|
||||
|
@ -360,8 +368,7 @@ public class SftpFileService extends AbstractFileService implements IFileService
|
|||
System.err.println("ssh.download: file size mismatch for "+remotePath);
|
||||
return false;
|
||||
}
|
||||
|
||||
Activator.trace("SftpFileService.download "+remoteFile+ " ok"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
//TODO handle exception properly: happens e.g. when trying to download a symlink.
|
||||
|
|
Loading…
Add table
Reference in a new issue