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

[216343] immediate link targets and canonical paths for Sftp

This commit is contained in:
Martin Oberhuber 2008-01-23 21:36:37 +00:00
parent fde69f9c35
commit 2fb3d273bb
2 changed files with 15 additions and 2 deletions

View file

@ -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;

View file

@ -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() {