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 3ab0cffb8aa..8ce2720d4c8 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 b40a11c591c..3f29903200d 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() {