Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Macguire2002-05-17 22:05:43 -0400
committerKevin Macguire2002-05-17 22:05:43 -0400
commit156238c4a701cb1c0061f3e9a1a2074885237ad0 (patch)
treef8cf41a98d51015218a953119894f3d3b169234e
parent266599bb2be8c6f86918b46e0ebaf55e55ac7626 (diff)
downloadeclipse.platform.team-156238c4a701cb1c0061f3e9a1a2074885237ad0.tar.gz
eclipse.platform.team-156238c4a701cb1c0061f3e9a1a2074885237ad0.tar.xz
eclipse.platform.team-156238c4a701cb1c0061f3e9a1a2074885237ad0.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/target/UrlUtil.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/target/UrlUtil.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/target/UrlUtil.java
index 8de387741..f724f7446 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/target/UrlUtil.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/target/UrlUtil.java
@@ -24,10 +24,15 @@ public class UrlUtil {
return root;
if(root.length() == 0)
return end.toString();
+ boolean rootHasTrailing = root.charAt(root.length() - 1) == Path.SEPARATOR; //has trailing '/'
+ boolean endHasLeading = end.isAbsolute(); // has leading '/'
- if(root.charAt(root.length() - 1) == Path.SEPARATOR)
- return root + end.toString(); //already has separator, just concat end
+ if(rootHasTrailing && endHasLeading) //http://mysite/ + /myFolder
+ return root + end.toString().substring(1); // we have two seperators, drop one
- return root + Path.SEPARATOR + end.toString();
+ if(!rootHasTrailing && !endHasLeading) //http://mysite + myFolder
+ return root + Path.SEPARATOR + end.toString();
+
+ return root + end.toString(); //have one separator between the two, just concat end
}
}

Back to the top