Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernd Hufmann2014-01-08 08:08:11 -0500
committerBernd Hufmann2014-01-14 10:36:32 -0500
commitde31ca550a0e1d03858cec33c0ad1c9522cfed4b (patch)
tree053d3c24633e07877cfdbf5d2b5471a78cf465d3
parent93d7a3e2ea85ca152c18db1c015c6ad871eb9d85 (diff)
downloadorg.eclipse.linuxtools-de31ca550a0e1d03858cec33c0ad1c9522cfed4b.tar.gz
org.eclipse.linuxtools-de31ca550a0e1d03858cec33c0ad1c9522cfed4b.tar.xz
org.eclipse.linuxtools-de31ca550a0e1d03858cec33c0ad1c9522cfed4b.zip
lttng: remove unnecessary slashes in session path for remote import
Bug 425082 Change-Id: Ie94e3d7125ce7ce1dc1ef2ab85a0d76738a67dae Signed-off-by: Bernd Hufmann <Bernd.Hufmann@ericsson.com> Reviewed-on: https://git.eclipse.org/r/20377 Tested-by: Hudson CI Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> IP-Clean: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/ImportDialog.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/ImportDialog.java b/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/ImportDialog.java
index b82653d800..f91e0df81c 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/ImportDialog.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.ui/src/org/eclipse/linuxtools/internal/lttng2/ui/views/control/dialogs/ImportDialog.java
@@ -19,6 +19,7 @@ import java.util.List;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
@@ -259,11 +260,14 @@ public class ImportDialog extends Dialog implements IImportDialog {
traceName.insert(0, '-');
String path = fSession.isSnapshotSession() ? fSession.getSnapshotInfo().getSnapshotPath() : fSession.getSessionPath();
+ path = getUnifiedPath(path);
+ String parentPath = getUnifiedPath(parent.getAbsolutePath());
- while (!parent.getAbsolutePath().equals(path)) {
+ while (!parentPath.equals(path)) {
traceName.insert(0, parent.getName());
traceName.insert(0, '-');
parent = parent.getParentRemoteFile();
+ parentPath = getUnifiedPath(parent.getAbsolutePath());
}
traceName.insert(0, parent.getName());
@@ -454,4 +458,9 @@ public class ImportDialog extends Dialog implements IImportDialog {
okButton.setEnabled(checked.length > 0);
}
}
+
+ private static String getUnifiedPath(String path) {
+ // Use Path class to remove unnecessary slashes
+ return new Path(path).removeTrailingSeparator().toString();
+ }
}

Back to the top