[jboss-svn-commits] JBoss Common SVN: r3586 - shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Oct 12 13:12:10 EDT 2009
Author: aslak
Date: 2009-10-12 13:12:10 -0400 (Mon, 12 Oct 2009)
New Revision: 3586
Modified:
shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/EnterpriseContainer.java
shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/LibraryContainer.java
shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ManifestContainer.java
shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ResourceAdapterContainer.java
shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ResourceContainer.java
shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/WebContainer.java
Log:
SHRINKWRAP-51 Added File|URL|Asset overloading methods
Modified: shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/EnterpriseContainer.java
===================================================================
--- shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/EnterpriseContainer.java 2009-10-02 16:46:15 UTC (rev 3585)
+++ shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/EnterpriseContainer.java 2009-10-12 17:12:10 UTC (rev 3586)
@@ -16,7 +16,11 @@
*/
package org.jboss.shrinkwrap.api.container;
+import java.io.File;
+import java.net.URL;
+
import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.Asset;
import org.jboss.shrinkwrap.api.Path;
/**
@@ -51,8 +55,32 @@
* @throws IllegalArgumentException if resourceName is null
*/
T setApplicationXML(String resourceName) throws IllegalArgumentException;
+
+ /**
+ *
+ * @param resource {@link File} resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException if resource is null
+ */
+ T setApplicationXML(File resource) throws IllegalArgumentException;
/**
+ *
+ * @param resource {@link URL} resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException if resource is null
+ */
+ T setApplicationXML(URL resource) throws IllegalArgumentException;
+
+ /**
+ *
+ * @param resource {@link Asset} resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException if resource is null
+ */
+ T setApplicationXML(Asset resource) throws IllegalArgumentException;
+
+ /**
* Adds a resource to this {@link Archive}s application context.
* <br/><br/>
* The {@link ClassLoader} used to obtain the resource is up to
@@ -68,6 +96,63 @@
T addApplicationResource(String resourceName) throws IllegalArgumentException;
/**
+ *
+ * @param resource {@link File} resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException if resource is null
+ */
+ T addApplicationResource(File resource) throws IllegalArgumentException;
+
+ /**
+ *
+ * @param resource {@link URL} resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException if resource is null
+ */
+ T addApplicationResource(URL resource) throws IllegalArgumentException;
+
+
+ /**
+ *
+ * @param target The target relative to application path within the archive into which we'll place the resource
+ * @param resourceName Name of the {@link ClassLoader} resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException if target is null
+ * @throws IllegalArgumentException if resource is null
+ */
+ T addApplicationResource(String target, String resourceName) throws IllegalArgumentException;
+
+ /**
+ *
+ * @param target The target relative to application path within the archive into which we'll place the resource
+ * @param resource {@link File} resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException if target is null
+ * @throws IllegalArgumentException if resource is null
+ */
+ T addApplicationResource(String target, File resource) throws IllegalArgumentException;
+
+ /**
+ *
+ * @param target The target relative to application path within the archive into which we'll place the resource
+ * @param resource {@link URL} resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException if target is null
+ * @throws IllegalArgumentException if resource is null
+ */
+ T addApplicationResource(String target, URL resource) throws IllegalArgumentException;
+
+ /**
+ *
+ * @param target The target relative to application path within the archive into which we'll place the resource
+ * @param resource {@link Asset} resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException if target is null
+ * @throws IllegalArgumentException if resource is null
+ */
+ T addApplicationResource(String target, Asset resource) throws IllegalArgumentException;
+
+ /**
* Adds a resource to this {@link Archive}s application context.
* <br/><br/>
* The {@link ClassLoader} used to obtain the resource is up to
@@ -77,13 +162,43 @@
* target of "example/myexample.xml" could be placed in
* "/META-INF/example/myexample.xml"
*
+ * @param target The target relative to application path within the archive into which we'll place the resource
* @param resourceName Name of the {@link ClassLoader} resource to add
- * @param newName New name of the resource in the container
* @return This virtual archive
* @throws IllegalArgumentException if target is null
* @throws IllegalArgumentException if resourceName is null
*/
T addApplicationResource(Path target, String resourceName) throws IllegalArgumentException;
+
+ /**
+ *
+ * @param target The target relative to application path within the archive into which we'll place the resource
+ * @param resource {@link File} resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException if target is null
+ * @throws IllegalArgumentException if resource is null
+ */
+ T addApplicationResource(Path target, File resource) throws IllegalArgumentException;
+
+ /**
+ *
+ * @param target The target relative to application path within the archive into which we'll place the resource
+ * @param resource {@link URL} resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException if target is null
+ * @throws IllegalArgumentException if resource is null
+ */
+ T addApplicationResource(Path target, URL resource) throws IllegalArgumentException;
+
+ /**
+ *
+ * @param target The target relative to application path within the archive into which we'll place the resource
+ * @param resource {@link Asset} resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException if target is null
+ * @throws IllegalArgumentException if resource is null
+ */
+ T addApplicationResource(Path target, Asset resource) throws IllegalArgumentException;
/**
* Adds a archive to this {@link Archive}s module context.
@@ -101,9 +216,25 @@
* <br/><br/>
* The resource name is used as path.
*
- * @param resourceName
+ * @param resourceName Name of the {@link ClassLoader} resource to add
* @return This virtual archive
* @throws IllegalArgumentException if resourceName is null
*/
T addModule(String resourceName) throws IllegalArgumentException;
+
+ /**
+ *
+ * @param resource {@link File} resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException if resource is null
+ */
+ T addModule(File resource) throws IllegalArgumentException;
+
+ /**
+ *
+ * @param resource {@link URL} resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException if resource is null
+ */
+ T addModule(URL resource) throws IllegalArgumentException;
}
Modified: shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/LibraryContainer.java
===================================================================
--- shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/LibraryContainer.java 2009-10-02 16:46:15 UTC (rev 3585)
+++ shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/LibraryContainer.java 2009-10-12 17:12:10 UTC (rev 3586)
@@ -16,7 +16,11 @@
*/
package org.jboss.shrinkwrap.api.container;
+import java.io.File;
+import java.net.URL;
+
import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.Asset;
import org.jboss.shrinkwrap.api.Path;
/**
@@ -54,6 +58,15 @@
*/
T addLibrary(String resourceName) throws IllegalArgumentException;
+ T addLibrary(File resource) throws IllegalArgumentException;
+ T addLibrary(URL resource) throws IllegalArgumentException;
+
+ T addLibrary(String target, String resourceName) throws IllegalArgumentException;
+ T addLibrary(String target, File resource) throws IllegalArgumentException;
+ T addLibrary(String target, URL resource) throws IllegalArgumentException;
+ T addLibrary(String target, Asset resource) throws IllegalArgumentException;
+
+
/**
* Adds the resource with the specified name
* as a library to the container under the target path, returning the container itself.
@@ -73,6 +86,10 @@
*/
T addLibrary(Path target, String resourceName) throws IllegalArgumentException;
+ T addLibrary(Path target, File resource) throws IllegalArgumentException;
+ T addLibrary(Path target, URL resource) throws IllegalArgumentException;
+ T addLibrary(Path target, Asset resource) throws IllegalArgumentException;
+
/**
* Add another {@link Archive} to this {@link Archive} as a Library.
* <br/><br/>
Modified: shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ManifestContainer.java
===================================================================
--- shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ManifestContainer.java 2009-10-02 16:46:15 UTC (rev 3585)
+++ shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ManifestContainer.java 2009-10-12 17:12:10 UTC (rev 3586)
@@ -16,7 +16,11 @@
*/
package org.jboss.shrinkwrap.api.container;
+import java.io.File;
+import java.net.URL;
+
import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.Asset;
import org.jboss.shrinkwrap.api.Path;
/**
@@ -53,6 +57,10 @@
*/
T setManifest(String resourceName) throws IllegalArgumentException;
+ T setManifest(File resource) throws IllegalArgumentException;
+ T setManifest(URL resource) throws IllegalArgumentException;
+ T setManifest(Asset resource) throws IllegalArgumentException;
+
/**
* Adds the resource with the specified name
* to the container, returning the container itself.
@@ -68,7 +76,16 @@
* @throws IllegalArgumentException if resourceName is null
*/
T addManifestResource(String resourceName) throws IllegalArgumentException;
+
+ T addManifestResource(File resource) throws IllegalArgumentException;
+ T addManifestResource(URL resource) throws IllegalArgumentException;
+
+ T addManifestResource(String target, String resourceName) throws IllegalArgumentException;
+ T addManifestResource(String target, File resource) throws IllegalArgumentException;
+ T addManifestResource(String target, URL resource) throws IllegalArgumentException;
+ T addManifestResource(String target, Asset resource) throws IllegalArgumentException;
+
/**
* Adds the resource with the specified name
* to the container, returning the container itself.
@@ -86,4 +103,7 @@
* @throws IllegalArgumentException if resourceName is null
*/
T addManifestResource(Path target, String resourceName) throws IllegalArgumentException;
+ T addManifestResource(Path target, File resource) throws IllegalArgumentException;
+ T addManifestResource(Path target, URL resource) throws IllegalArgumentException;
+ T addManifestResource(Path target, Asset resource) throws IllegalArgumentException;
}
Modified: shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ResourceAdapterContainer.java
===================================================================
--- shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ResourceAdapterContainer.java 2009-10-02 16:46:15 UTC (rev 3585)
+++ shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ResourceAdapterContainer.java 2009-10-12 17:12:10 UTC (rev 3586)
@@ -16,7 +16,11 @@
*/
package org.jboss.shrinkwrap.api.container;
+import java.io.File;
+import java.net.URL;
+
import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.Asset;
/**
* ResourceAdapterContainer
@@ -45,5 +49,11 @@
* if resourceName is null
*/
T setResourceAdapterXML(String resourceName) throws IllegalArgumentException;
+
+ T setResourceAdapterXML(File resource) throws IllegalArgumentException;
+
+ T setResourceAdapterXML(URL resource) throws IllegalArgumentException;
+
+ T setResourceAdapterXML(Asset resource) throws IllegalArgumentException;
}
Modified: shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ResourceContainer.java
===================================================================
--- shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ResourceContainer.java 2009-10-02 16:46:15 UTC (rev 3585)
+++ shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ResourceContainer.java 2009-10-12 17:12:10 UTC (rev 3586)
@@ -16,9 +16,11 @@
*/
package org.jboss.shrinkwrap.api.container;
+import java.io.File;
import java.net.URL;
import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.Asset;
import org.jboss.shrinkwrap.api.Path;
/**
@@ -56,11 +58,30 @@
* @throws IllegalArgumentException If the name is null
*/
T addResource(String resourceName) throws IllegalArgumentException;
+
+ /**
+ *
+ * @param resource The resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException If the resource is null
+ */
+ T addResource(File resource) throws IllegalArgumentException;
/**
+ * Adds the resource located at the specified {@link URL} to the {@link Archive}. The
+ * location within the archive will be equal to the path portion of the
+ * specified {@link URL}.
+ *
+ * @param resource The resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException If the resource is null
+ */
+ T addResource(URL resource) throws IllegalArgumentException;
+
+ /**
* Adds the resource with the specified name
* to the container, returning the container itself.
- * <br/><br/>
+ * <br/><br/>
* The {@link ClassLoader} used to obtain the resource is up to
* the implementation. The resource will be placed into
* the Container under the same context specified by
@@ -72,12 +93,42 @@
* @throws IllegalArgumentException If the target is null
* @throws IllegalArgumentException If the resourceName is null
*/
- T addResource(Path target, String resourceName) throws IllegalArgumentException;
+ T addResource(String target, String resourceName) throws IllegalArgumentException;
+
+ /**
+ *
+ * @param target The target within the archive into which we'll place the resource
+ * @param resource The resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException If the target is null
+ * @throws IllegalArgumentException If the resource is null
+ */
+ T addResource(String target, File resource) throws IllegalArgumentException;
+
+ /**
+ *
+ * @param target The target within the archive into which we'll place the resource
+ * @param resource The resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException If the target is null
+ * @throws IllegalArgumentException If the resource is null
+ */
+ T addResource(String target, URL resource) throws IllegalArgumentException;
/**
+ *
+ * @param target The target within the archive into which we'll place the resource
+ * @param resource The resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException If the target is null
+ * @throws IllegalArgumentException If the resource is null
+ */
+ T addResource(String target, Asset resource) throws IllegalArgumentException;
+
+ /**
* Adds the resource with the specified name
* to the container, returning the container itself.
- * <br/><br/>
+ * <br/><br/>
* The {@link ClassLoader} used to obtain the resource is up to
* the implementation. The resource will be placed into
* the Container under the same context specified by
@@ -89,8 +140,8 @@
* @throws IllegalArgumentException If the target is null
* @throws IllegalArgumentException If the resourceName is null
*/
- T addResource(String target, String resourceName) throws IllegalArgumentException;
-
+ T addResource(Path target, String resourceName) throws IllegalArgumentException;
+
/**
* Adds the specified resource to the {@link Archive}, using the specified {@link ClassLoader}
* to load the resource
@@ -105,27 +156,36 @@
*/
T addResource(Path target, String resourceName, ClassLoader classLoader) throws IllegalArgumentException;
+
/**
- * Adds the resource located at the specified {@link URL} to the {@link Archive}. The
- * location within the archive will be equal to the path portion of the
- * specified {@link URL}.
*
- * @param resource The location of the resource to load
+ * @param target The target within the archive into which we'll place the resource
+ * @param resource The resource to add
* @return This virtual archive
- * @throws IllegalArgumentException If the location is null
+ * @throws IllegalArgumentException If the target is null
+ * @throws IllegalArgumentException If the resource is null
*/
- T addResource(URL resource) throws IllegalArgumentException;
+ T addResource(Path target, File resource) throws IllegalArgumentException;
/**
* Adds the resource located at the specified {@link URL} to
* the archive at the specified path.
*
- * @param newtarget The target within the archive into which we'll place the resource
- * @param resource The location of the resource to load
+ * @param target The target within the archive into which we'll place the resource
+ * @param resource The resource to add
* @return This virtual archive
* @throws IllegalArgumentException If the target is null
- * @throws IllegalArgumentException If the location is null
+ * @throws IllegalArgumentException If the resource is null
*/
T addResource(Path target, URL resource) throws IllegalArgumentException;
+ /**
+ *
+ * @param target The target within the archive into which we'll place the resource
+ * @param resource The resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException If the target is null
+ * @throws IllegalArgumentException If the resource is null
+ */
+ T addResource(Path target, Asset resource) throws IllegalArgumentException;
}
Modified: shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/WebContainer.java
===================================================================
--- shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/WebContainer.java 2009-10-02 16:46:15 UTC (rev 3585)
+++ shrinkwrap/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/WebContainer.java 2009-10-12 17:12:10 UTC (rev 3586)
@@ -16,7 +16,11 @@
*/
package org.jboss.shrinkwrap.api.container;
+import java.io.File;
+import java.net.URL;
+
import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.Asset;
import org.jboss.shrinkwrap.api.Path;
/**
@@ -39,7 +43,7 @@
//-------------------------------------------------------------------------------------||
/**
- * Adds a resource to this Archive as web.xml.
+ * Adds a resource to this Archive as /WEB-INF/web.xml.
* <br/><br/>
* The {@link ClassLoader} used to obtain the resource is up to
* the implementation.
@@ -54,6 +58,33 @@
T setWebXML(String resourceName) throws IllegalArgumentException;
/**
+ * Adds a resource to this Archive as /WEB-INF/web.xml.
+ *
+ * @param resource {@link File} resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException if resource is null
+ */
+ T setWebXML(File resource) throws IllegalArgumentException;
+
+ /**
+ * Adds a resource to this Archive as /WEB-INF/web.xml.
+ *
+ * @param resource {@link URL} resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException if resource is null
+ */
+ T setWebXML(URL resource) throws IllegalArgumentException;
+
+ /**
+ * Adds a resource to this Archive as /WEB-INF/web.xml.
+ *
+ * @param resource {@link Asset} resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException if resource is null
+ */
+ T setWebXML(Asset resource) throws IllegalArgumentException;
+
+ /**
* Adds the resource with the specified name
* to the container, returning the container itself.
* <br/><br/>
@@ -63,13 +94,69 @@
* For instance a resourceName of "test/example.xml" could be placed in
* "/WEB-INF/test/example.xml"
*
- * @param resourceName
- * @return
- * @throws IllegalArgumentException
+ * @param resourceName Name of the {@link ClassLoader} resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException if resourceName is null
*/
T addWebResource(String resourceName) throws IllegalArgumentException;
/**
+ *
+ * @param resource {@link File} resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException if resource is null
+ */
+ T addWebResource(File resource) throws IllegalArgumentException;
+
+ /**
+ *
+ * @param resource {@link URL} resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException if resource is null
+ */
+ T addWebResource(URL resource) throws IllegalArgumentException;
+
+ /**
+ *
+ * @param target The target relative to Web path within the archive into which we'll place the resource
+ * @param resourceName Name of the {@link ClassLoader} resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException if target is null
+ * @throws IllegalArgumentException if resourceName is null
+ */
+ T addWebResource(String target, String resourceName) throws IllegalArgumentException;
+
+ /**
+ *
+ * @param target The target relative to Web path within the archive into which we'll place the resource
+ * @param resource {@link File} resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException if target is null
+ * @throws IllegalArgumentException if resource is null
+ */
+ T addWebResource(String target, File resource) throws IllegalArgumentException;
+
+ /**
+ *
+ * @param target The target relative to Web path within the archive into which we'll place the resource
+ * @param resource {@link URL} resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException if target is null
+ * @throws IllegalArgumentException if resource is null
+ */
+ T addWebResource(String target, URL resource) throws IllegalArgumentException;
+
+ /**
+ *
+ * @param target The target relative to Web path within the archive into which we'll place the resource
+ * @param resource {@link Asset} resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException if target is null
+ * @throws IllegalArgumentException if resource is null
+ */
+ T addWebResource(String target, Asset resource) throws IllegalArgumentException;
+
+ /**
* Adds the resource with the specified name
* to the container, returning the container itself.
* <br/><br/>
@@ -79,11 +166,41 @@
* For instance a resourceName of "test/library.xml" and target of "/test/example.xml" could be placed in
* "/lib/test/example.xml".
*
- * @param target The target relative to Manifest path within the archive into which we'll place the resource
+ * @param target The target relative to Web path within the archive into which we'll place the resource
* @param resourceName Name of the {@link ClassLoader} resource to add
* @return This virtual archive
* @throws IllegalArgumentException if target is null
* @throws IllegalArgumentException if resourceName is null
*/
T addWebResource(Path target, String resourceName) throws IllegalArgumentException;
+
+ /**
+ *
+ * @param target The target relative to Web path within the archive into which we'll place the resource
+ * @param resource {@link File} resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException if target is null
+ * @throws IllegalArgumentException if resource is null
+ */
+ T addWebResource(Path target, File resource) throws IllegalArgumentException;
+
+ /**
+ *
+ * @param target The target relative to Web path within the archive into which we'll place the resource
+ * @param resource {@link URL} resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException if target is null
+ * @throws IllegalArgumentException if resource is null
+ */
+ T addWebResource(Path target, URL resource) throws IllegalArgumentException;
+
+ /**
+ *
+ * @param target The target relative to Web path within the archive into which we'll place the resource
+ * @param resource {@link Asset} resource to add
+ * @return This virtual archive
+ * @throws IllegalArgumentException if target is null
+ * @throws IllegalArgumentException if resource is null
+ */
+ T addWebResource(Path target, Asset resource) throws IllegalArgumentException;
}
More information about the jboss-svn-commits
mailing list