Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2009-04-17 18:05:23 -0400
committerThomas Watson2009-04-17 18:05:23 -0400
commit73bd7ded1d526226b5478df69c08e8062a6c5df4 (patch)
treee1e6710cb184fe508b8b1647222e4cea1617372c
parent48b67090f67e9cfcb2422a966fbd69fc7692c7be (diff)
downloadrt.equinox.framework-73bd7ded1d526226b5478df69c08e8062a6c5df4.tar.gz
rt.equinox.framework-73bd7ded1d526226b5478df69c08e8062a6c5df4.tar.xz
rt.equinox.framework-73bd7ded1d526226b5478df69c08e8062a6c5df4.zip
Bug 155465 FileBundleEntry should return names ending in '/' for directory entries
-rw-r--r--bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/bundlefile/BundleFile.java4
-rw-r--r--bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/bundlefile/DirZipBundleEntry.java2
2 files changed, 4 insertions, 2 deletions
diff --git a/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/bundlefile/BundleFile.java b/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/bundlefile/BundleFile.java
index 4577a95e8..86b4b5059 100644
--- a/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/bundlefile/BundleFile.java
+++ b/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/bundlefile/BundleFile.java
@@ -212,7 +212,9 @@ abstract public class BundleFile {
}
public static String fixTrailingSlash(String path, BundleEntry entry) {
- if (path.length() == 0 || path.charAt(0) != '/')
+ if (path.length() == 0)
+ return "/"; //$NON-NLS-1$
+ if (path.charAt(0) != '/')
path = '/' + path;
String name = entry.getName();
boolean pathSlash = path.charAt(path.length() - 1) == '/';
diff --git a/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/bundlefile/DirZipBundleEntry.java b/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/bundlefile/DirZipBundleEntry.java
index 352a67eef..6e33778bf 100644
--- a/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/bundlefile/DirZipBundleEntry.java
+++ b/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/bundlefile/DirZipBundleEntry.java
@@ -34,7 +34,7 @@ public class DirZipBundleEntry extends BundleEntry {
String name;
public DirZipBundleEntry(ZipBundleFile bundleFile, String name) {
- this.name = (name.length() > 0 && name.charAt(0) == '/') ? name.substring(1) : name;
+ this.name = (name.length() > 1 && name.charAt(0) == '/') ? name.substring(1) : name;
this.bundleFile = bundleFile;
}

Back to the top