diff options
author | Martin Oberhuber | 2008-01-23 21:36:37 +0000 |
---|---|---|
committer | Martin Oberhuber | 2008-01-23 21:36:37 +0000 |
commit | 2fb3d273bb2134df321b65abaa232ade7d4017fa (patch) | |
tree | 5b0ccaa935cd3900ff77dd3c56f3a4c7b4039b06 | |
parent | fde69f9c355a08bee4802e4371f313b6dea024f9 (diff) | |
download | org.eclipse.tm-2fb3d273bb2134df321b65abaa232ade7d4017fa.tar.gz org.eclipse.tm-2fb3d273bb2134df321b65abaa232ade7d4017fa.tar.xz org.eclipse.tm-2fb3d273bb2134df321b65abaa232ade7d4017fa.zip |
[216343] immediate link targets and canonical paths for Sftp
2 files changed, 15 insertions, 2 deletions
diff --git a/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/internal/services/ssh/files/SftpFileService.java b/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/internal/services/ssh/files/SftpFileService.java index 3ab0cffb8..8ce2720d4 100644 --- a/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/internal/services/ssh/files/SftpFileService.java +++ b/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/internal/services/ssh/files/SftpFileService.java @@ -20,7 +20,8 @@ * David McKnight (IBM) - [210109] store constants in IFileService rather than IFileServiceConstants * Kevin Doyle (IBM) - [208778] [efs][api] RSEFileStore#getOutputStream() does not support EFS#APPEND * Kevin Doyle (IBM) - [211374] [ssh] New File on SSH has unnecessary space in its contents - * David McKnight (IBM) - [209593] [api] add support for "file permissions" and "owner" properties for unix files + * David McKnight (IBM) - [209593] [api] add support for "file permissions" and "owner" properties for unix files + * Martin Oberhuber (Wind River) - [216343] immediate link targets and canonical paths for Sftp *******************************************************************************/ package org.eclipse.rse.internal.services.ssh.files; diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.ssh/src/org/eclipse/rse/internal/subsystems/files/ssh/SftpRemoteFile.java b/rse/plugins/org.eclipse.rse.subsystems.files.ssh/src/org/eclipse/rse/internal/subsystems/files/ssh/SftpRemoteFile.java index b40a11c59..3f2990320 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.ssh/src/org/eclipse/rse/internal/subsystems/files/ssh/SftpRemoteFile.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.ssh/src/org/eclipse/rse/internal/subsystems/files/ssh/SftpRemoteFile.java @@ -13,6 +13,7 @@ * * Contributors: * Martin Oberhuber (Wind River) - Adapted from FTPRemoteFile. + * Martin Oberhuber (Wind River) - [216343] immediate link targets and canonical paths for Sftp *******************************************************************************/ package org.eclipse.rse.internal.subsystems.files.ssh; @@ -38,7 +39,18 @@ public class SftpRemoteFile extends AbstractRemoteFile { } public String getCanonicalPath() { - return getSftpHostFile().getCanonicalPath(); + String canPath = getSftpHostFile().getCanonicalPath(); + if (canPath.equals(getAbsolutePath()) && _parentFile!=null) { + String parentCanPath = _parentFile.getCanonicalPath(); + StringBuffer path = new StringBuffer(parentCanPath); + if (!parentCanPath.endsWith("/")) //$NON-NLS-1$ + { + path.append('/'); + } + path.append(getName()); + canPath = path.toString(); + } + return canPath; } public String getClassification() { |