From ec66da7bf430e3a5658b56108794d90a2d44cdeb Mon Sep 17 00:00:00 2001 From: Martin Oberhuber < martin.oberhuber@windriver.com> Date: Thu, 17 Aug 2006 10:20:34 +0000 Subject: [PATCH] Fix FTP absolute pathes reported as //dir/file --- .../rse/services/files/ftp/FTPHostFile.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.services.files.ftp/src/org/eclipse/rse/services/files/ftp/FTPHostFile.java b/rse/plugins/org.eclipse.rse.services.files.ftp/src/org/eclipse/rse/services/files/ftp/FTPHostFile.java index eac8570b4ab..28e2595fa30 100644 --- a/rse/plugins/org.eclipse.rse.services.files.ftp/src/org/eclipse/rse/services/files/ftp/FTPHostFile.java +++ b/rse/plugins/org.eclipse.rse.services.files.ftp/src/org/eclipse/rse/services/files/ftp/FTPHostFile.java @@ -83,16 +83,17 @@ public class FTPHostFile implements IHostFile public String getAbsolutePath() { - - StringBuffer path = new StringBuffer(getParentPath()); - if (!_parentPath.endsWith("/")) - { - path.append('/'); + if (isRoot()) { + return getName(); + } else { + StringBuffer path = new StringBuffer(getParentPath()); + if (!_parentPath.endsWith("/")) + { + path.append('/'); + } + path.append(getName()); + return path.toString(); } - path.append(getName()); - - - return path.toString(); } public long getSize()