You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by ma...@apache.org on 2010/01/17 14:30:26 UTC

svn commit: r900136 - in /incubator/aries/trunk/web/web-urlhandler/src/main/java/org/apache/aries/web/converter: WarToWabConverter.java impl/WarToWabConverterImpl.java

Author: mahrwald
Date: Sun Jan 17 13:30:26 2010
New Revision: 900136

URL: http://svn.apache.org/viewvc?rev=900136&view=rev
Log:
ARIES-115 Add a bit of javadoc

Modified:
    incubator/aries/trunk/web/web-urlhandler/src/main/java/org/apache/aries/web/converter/WarToWabConverter.java
    incubator/aries/trunk/web/web-urlhandler/src/main/java/org/apache/aries/web/converter/impl/WarToWabConverterImpl.java

Modified: incubator/aries/trunk/web/web-urlhandler/src/main/java/org/apache/aries/web/converter/WarToWabConverter.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/web/web-urlhandler/src/main/java/org/apache/aries/web/converter/WarToWabConverter.java?rev=900136&r1=900135&r2=900136&view=diff
==============================================================================
--- incubator/aries/trunk/web/web-urlhandler/src/main/java/org/apache/aries/web/converter/WarToWabConverter.java (original)
+++ incubator/aries/trunk/web/web-urlhandler/src/main/java/org/apache/aries/web/converter/WarToWabConverter.java Sun Jan 17 13:30:26 2010
@@ -23,16 +23,27 @@
 import java.util.Properties;
 import java.util.jar.Manifest;
 
+/**
+ * Service interface for WAR to WAB conversion
+ */
 public interface WarToWabConverter {
+  /**
+   * Support class for WabConverter to allow multiple passes over an input war
+   * archive without requiring in-memory buffering.
+   */
   public static interface InputStreamProvider {
     InputStream getInputStream() throws IOException;
   }
 
+  public static final String WEB_CONTEXT_PATH = "Web-ContextPath";
+  public static final String WEB_JSP_EXTRACT_LOCATION = "Web-JSPExtractLocation";
+
+  
   /**
-   * Generate the new manifest for the 
+   * Generate the new manifest for the converted war file.
    * @param input
    * @param name The name of the war file
-   * @param properties Properties to influence the conversion as defined in RFC66
+   * @param properties Properties to influence the conversion as defined in RFC66 (see also {@link #convert} method)
    * @return
    */
   Manifest generateManifest(InputStreamProvider input, String name, Properties properties) throws IOException;
@@ -42,7 +53,21 @@
    * and has the new manifest.
    * @param input
    * @param name The name of the war file
-   * @param properties Properties to influence the conversion as defined in RFC66
+   * @param properties Properties to influence the conversion as defined in RFC66. The following
+   * properties are supported
+   * <ul>
+   *    <li>Bundle-ClassPath</li>
+   *    <li>Bundle-ManifestVersion</li>
+   *    <li>Bundle-SymbolicName</li>
+   *    <li>Bundle-Version</li>
+   *    <li>Import-Package</li>
+   *    <li>Web-ContextPath</li>
+   *    <li>Web-JSPExtractLocation</li>
+   * </ul>
+   * Except for Bundle-ClassPath and Import-Package any supplied properties will
+   * overwrite values specified in an existing bundle manifest. For Bundle-ClassPath and Import-Package 
+   * the supplied values will be joined to those specified in a bundle manifest
+   * (if it exists) and also the results of the scan of the WAR file.
    * @return
    */
   InputStream convert(InputStreamProvider input, String name, Properties properties) throws IOException;

Modified: incubator/aries/trunk/web/web-urlhandler/src/main/java/org/apache/aries/web/converter/impl/WarToWabConverterImpl.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/web/web-urlhandler/src/main/java/org/apache/aries/web/converter/impl/WarToWabConverterImpl.java?rev=900136&r1=900135&r2=900136&view=diff
==============================================================================
--- incubator/aries/trunk/web/web-urlhandler/src/main/java/org/apache/aries/web/converter/impl/WarToWabConverterImpl.java (original)
+++ incubator/aries/trunk/web/web-urlhandler/src/main/java/org/apache/aries/web/converter/impl/WarToWabConverterImpl.java Sun Jan 17 13:30:26 2010
@@ -18,6 +18,9 @@
  */
 package org.apache.aries.web.converter.impl;
 
+import static org.apache.aries.web.converter.WarToWabConverter.WEB_CONTEXT_PATH;
+import static org.apache.aries.web.converter.WarToWabConverter.WEB_JSP_EXTRACT_LOCATION;
+
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
@@ -57,12 +60,6 @@
   private static final String DEFAULT_WEB_CONTEXT_PATH = "/";
   private static final String DEFAULT_WEB_JSP_EXTRACT_LOCATION = "/";
 
-  // TODO: These constants should be in the framework but at the time of write
-  // they
-  // do not exist. When they do we need to point at their values instead.
-  public static final String WEB_CONTEXT_PATH = "Web-ContextPath";
-  public static final String WEB_JSP_EXTRACT_LOCATION = "Web-JSPExtractLocation";
-
   private Properties properties;
 
   // InputStream for the new WAB file