Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVioleta Georgieva2015-02-22 15:52:42 +0000
committerVioleta Georgieva2015-02-22 15:52:42 +0000
commit30e1f6235572e10b265b221104ef3a9e230ba147 (patch)
tree86a1b0a288fb3b9996f301792a049d8bffbcbbd8
parent9e0a951ac5491b072d3804041480ec30a70e4ab1 (diff)
downloadorg.eclipse.gemini.web.gemini-web-container-30e1f6235572e10b265b221104ef3a9e230ba147.tar.gz
org.eclipse.gemini.web.gemini-web-container-30e1f6235572e10b265b221104ef3a9e230ba147.tar.xz
org.eclipse.gemini.web.gemini-web-container-30e1f6235572e10b265b221104ef3a9e230ba147.zip
In Felix URL scheme is 'bundle' - make the implementation in a way to handle Equinox and Felix URL schemes.
-rw-r--r--org.eclipse.gemini.web.tomcat/src/main/java/org/eclipse/gemini/web/tomcat/internal/bundleresources/BundleURLStreamHandlerService.java2
-rw-r--r--org.eclipse.gemini.web.tomcat/src/main/java/org/eclipse/gemini/web/tomcat/internal/bundleresources/BundleWebResourceRoot.java10
2 files changed, 6 insertions, 6 deletions
diff --git a/org.eclipse.gemini.web.tomcat/src/main/java/org/eclipse/gemini/web/tomcat/internal/bundleresources/BundleURLStreamHandlerService.java b/org.eclipse.gemini.web.tomcat/src/main/java/org/eclipse/gemini/web/tomcat/internal/bundleresources/BundleURLStreamHandlerService.java
index 1b71082..a594906 100644
--- a/org.eclipse.gemini.web.tomcat/src/main/java/org/eclipse/gemini/web/tomcat/internal/bundleresources/BundleURLStreamHandlerService.java
+++ b/org.eclipse.gemini.web.tomcat/src/main/java/org/eclipse/gemini/web/tomcat/internal/bundleresources/BundleURLStreamHandlerService.java
@@ -25,7 +25,7 @@ import org.osgi.service.url.AbstractURLStreamHandlerService;
public class BundleURLStreamHandlerService extends AbstractURLStreamHandlerService {
- private static final String WAR_BUNDLE_ENTRY_SCHEMA = "war:bundleentry";
+ private static final String WAR_BUNDLE_ENTRY_SCHEMA = "war:bundle";
private static final String WAR_TO_ENTRY_SEPARATOR = "\\^/";
diff --git a/org.eclipse.gemini.web.tomcat/src/main/java/org/eclipse/gemini/web/tomcat/internal/bundleresources/BundleWebResourceRoot.java b/org.eclipse.gemini.web.tomcat/src/main/java/org/eclipse/gemini/web/tomcat/internal/bundleresources/BundleWebResourceRoot.java
index 7360db0..b61be78 100644
--- a/org.eclipse.gemini.web.tomcat/src/main/java/org/eclipse/gemini/web/tomcat/internal/bundleresources/BundleWebResourceRoot.java
+++ b/org.eclipse.gemini.web.tomcat/src/main/java/org/eclipse/gemini/web/tomcat/internal/bundleresources/BundleWebResourceRoot.java
@@ -119,11 +119,12 @@ public class BundleWebResourceRoot extends StandardRoot {
private String archivePath = "";
BaseLocation(URL url) {
- if ("jar".equals(url.getProtocol())) {
+ String protocol = url.getProtocol();
+ if ("jar".equals(protocol)) {
String jarUrl = url.toString();
int endOfFileUrl = jarUrl.indexOf("!/");
String fileUrl = jarUrl.substring(4, endOfFileUrl);
- if (fileUrl.startsWith("bundleentry")) {
+ if (fileUrl.startsWith("bundle")) {
URL file = null;
try {
file = new URL(fileUrl);
@@ -133,13 +134,12 @@ public class BundleWebResourceRoot extends StandardRoot {
this.archivePath = file.getFile();
this.basePath = fileUrl.substring(0, fileUrl.indexOf(this.archivePath));
}
- } else if ("bundleentry".equals(url.getProtocol())) {
+ } else if (protocol != null && protocol.startsWith("bundle")) {
this.archivePath = url.getFile();
String fileUrl = url.toString();
this.basePath = fileUrl.substring(0, fileUrl.indexOf(this.archivePath));
} else {
- throw new IllegalArgumentException("The URL protocol [" + url.getProtocol()
- + "] is not supported by this web resources implementation");
+ throw new IllegalArgumentException("The URL protocol [" + protocol + "] is not supported by this web resources implementation");
}
}

Back to the top