aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlyn Normington2011-06-03 09:24:20 (EDT)
committerGlyn Normington2011-06-03 09:24:20 (EDT)
commitc9d4810d9240a8953538f994905f47b02ea1e0b6 (patch)
tree3fdb70d70653d30800dec3fa31ba516f196f6bb9
parente5d48bd0dc73d85d7084aa2ebc66066309af35aa (diff)
downloadorg.eclipse.gemini.web.gemini-web-container-c9d4810d9240a8953538f994905f47b02ea1e0b6.zip
org.eclipse.gemini.web.gemini-web-container-c9d4810d9240a8953538f994905f47b02ea1e0b6.tar.gz
org.eclipse.gemini.web.gemini-web-container-c9d4810d9240a8953538f994905f47b02ea1e0b6.tar.bz2
bug 326798: rename SpringSource-DefaultWABHeaders to org.eclipse.gemini.web-DefaultWABHeaders
-rw-r--r--org.eclipse.gemini.web.core/src/main/java/org/eclipse/gemini/web/core/InstallationOptions.java5
-rw-r--r--org.eclipse.gemini.web.core/src/main/java/org/eclipse/gemini/web/internal/WebContainerUtils.java6
-rw-r--r--org.eclipse.gemini.web.core/src/main/java/org/eclipse/gemini/web/internal/url/WebBundleUrlStreamHandlerService.java14
3 files changed, 13 insertions, 12 deletions
diff --git a/org.eclipse.gemini.web.core/src/main/java/org/eclipse/gemini/web/core/InstallationOptions.java b/org.eclipse.gemini.web.core/src/main/java/org/eclipse/gemini/web/core/InstallationOptions.java
index b0b5ff0..8e771d4 100644
--- a/org.eclipse.gemini.web.core/src/main/java/org/eclipse/gemini/web/core/InstallationOptions.java
+++ b/org.eclipse.gemini.web.core/src/main/java/org/eclipse/gemini/web/core/InstallationOptions.java
@@ -24,7 +24,6 @@ import java.util.Set;
import org.eclipse.gemini.web.internal.WebContainerUtils;
import org.osgi.framework.Constants;
-
/**
* Simple utility class that parses the user-supplied installation options from a {@link Map}.
*/
@@ -92,7 +91,7 @@ public final class InstallationOptions {
this.webContextPath = normalisedOptions.get(WebContainerUtils.HEADER_WEB_CONTEXT_PATH);
this.webJSPExtractLocation = normalisedOptions.get(WebContainerUtils.HEADER_WEB_JSP_EXTRACT_LOCATION);
- this.defaultWABHeaders = options.get(WebContainerUtils.HEADER_SPRINGSOURCE_DEFAULT_WAB_HEADERS) != null;
+ this.defaultWABHeaders = (options.get(WebContainerUtils.HEADER_DEFAULT_WAB_HEADERS) != null);
}
private Map<String, String> normalise(Map<String, String> options) {
@@ -194,7 +193,7 @@ public final class InstallationOptions {
public boolean getDefaultWABHeaders() {
return this.defaultWABHeaders;
}
-
+
public void setDefaultWABHeaders(boolean defaultWABHeaders) {
this.defaultWABHeaders = defaultWABHeaders;
}
diff --git a/org.eclipse.gemini.web.core/src/main/java/org/eclipse/gemini/web/internal/WebContainerUtils.java b/org.eclipse.gemini.web.core/src/main/java/org/eclipse/gemini/web/internal/WebContainerUtils.java
index 0f2cffa..b23cbad 100644
--- a/org.eclipse.gemini.web.core/src/main/java/org/eclipse/gemini/web/internal/WebContainerUtils.java
+++ b/org.eclipse.gemini.web.core/src/main/java/org/eclipse/gemini/web/internal/WebContainerUtils.java
@@ -35,10 +35,10 @@ public final class WebContainerUtils {
public static final String HEADER_WEB_CONTEXT_PATH = "Web-ContextPath";
/**
- * Constant for the <code>SpringSource-SystemPackages</code> manifest header.
+ * Constant for the <code>SpringSource-DefaultWABHeaders</code> manifest header.
*/
- public static final String HEADER_SPRINGSOURCE_DEFAULT_WAB_HEADERS = "SpringSource-DefaultWABHeaders";
-
+ public static final String HEADER_DEFAULT_WAB_HEADERS = "org.eclipse.gemini.web-DefaultWABHeaders";
+
/**
* Constant for the <code>Web-JSPExtractLocation</code> manifest header.
*/
diff --git a/org.eclipse.gemini.web.core/src/main/java/org/eclipse/gemini/web/internal/url/WebBundleUrlStreamHandlerService.java b/org.eclipse.gemini.web.core/src/main/java/org/eclipse/gemini/web/internal/url/WebBundleUrlStreamHandlerService.java
index 5b73c40..f095cb9 100644
--- a/org.eclipse.gemini.web.core/src/main/java/org/eclipse/gemini/web/internal/url/WebBundleUrlStreamHandlerService.java
+++ b/org.eclipse.gemini.web.core/src/main/java/org/eclipse/gemini/web/internal/url/WebBundleUrlStreamHandlerService.java
@@ -35,7 +35,6 @@ import java.util.zip.ZipEntry;
import org.osgi.service.url.AbstractURLStreamHandlerService;
import org.osgi.service.url.URLStreamHandlerService;
-
import org.eclipse.gemini.web.core.InstallationOptions;
import org.eclipse.gemini.web.core.WebBundleManifestTransformer;
import org.eclipse.gemini.web.internal.WebContainerUtils;
@@ -56,8 +55,9 @@ import org.eclipse.virgo.util.osgi.manifest.BundleManifestFactory;
* @see WebBundleManifestTransformer
*/
public final class WebBundleUrlStreamHandlerService extends AbstractURLStreamHandlerService {
+
private static final String FILE_PROTOCOL = "file";
-
+
private final WebBundleManifestTransformer transformer;
public WebBundleUrlStreamHandlerService(WebBundleManifestTransformer transformer) {
@@ -68,7 +68,7 @@ public final class WebBundleUrlStreamHandlerService extends AbstractURLStreamHan
public URLConnection openConnection(URL u) throws IOException {
WebBundleUrl url = new WebBundleUrl(u);
URL actualUrl = new URL(url.getLocation());
-
+
if (FILE_PROTOCOL.equals(actualUrl.getProtocol()) && new File(actualUrl.getPath()).isDirectory()) {
DirTransformer dirTransformer = new DirTransformer(new Callback(actualUrl, url, this.transformer));
return new DirTransformingURLConnection(actualUrl, dirTransformer, true);
@@ -79,9 +79,11 @@ public final class WebBundleUrlStreamHandlerService extends AbstractURLStreamHan
}
private static final class Callback implements JarTransformerCallback, DirTransformerCallback {
+
private static final String META_INF = "META-INF";
+
private static final String MANIFEST_MF = "MANIFEST.MF";
-
+
private final WebBundleManifestTransformer transformer;
private final URL sourceURL;
@@ -110,7 +112,7 @@ public final class WebBundleUrlStreamHandlerService extends AbstractURLStreamHan
InputStreamReader reader = new InputStreamReader(inputStream);
BundleManifest manifest = BundleManifestFactory.createBundleManifest(reader);
InstallationOptions options = new InstallationOptions(this.webBundleUrl.getOptions());
- if (manifest.getHeader(WebContainerUtils.HEADER_SPRINGSOURCE_DEFAULT_WAB_HEADERS) != null) {
+ if (manifest.getHeader(WebContainerUtils.HEADER_DEFAULT_WAB_HEADERS) != null) {
options.setDefaultWABHeaders(true);
}
@@ -119,7 +121,7 @@ public final class WebBundleUrlStreamHandlerService extends AbstractURLStreamHan
toManifest(manifest.toDictionary()).write(outputStream);
}
-
+
private boolean isSignatureFile(String entryName) {
String[] entryNameComponents = entryName.split("/");
if (entryNameComponents.length == 2) {