org.jboss.shrinkwrap.api.container
Interface WebContainer<T extends Archive<T>>

Type Parameters:
T -
All Known Subinterfaces:
WebArchive

public interface WebContainer<T extends Archive<T>>

Defines the contract for a component capable of storing web-related resources.

The actual path to the Web resources within the Archive is up to the implementations/specifications.

Version:
$Revision: $
Author:
Aslak Knutsen

Method Summary
 T addAsWebInfResource(Asset resource, ArchivePath target)
          Adds the Asset as a WEB-INF resource to the container, returning the container itself.
 T addAsWebInfResource(Asset resource, String target)
          Adds the Asset as a WEB-INF resource to the container, returning the container itself.
 T addAsWebInfResource(File resource)
          Adds the File as a WEB-INF resource to the container, returning the container itself.
 T addAsWebInfResource(File resource, ArchivePath target)
          Adds the File as a WEB-INF resource to the container, returning the container itself.
 T addAsWebInfResource(File resource, String target)
          Adds the File as a WEB-INF resource to the container, returning the container itself.
 T addAsWebInfResource(Package resourcePackage, String resourceName)
          Adds the resource as a WEB-INF resource to the container, returning the container itself.
 T addAsWebInfResource(Package resourcePackage, String resourceName, ArchivePath target)
          Adds the resource as a WEB-INF resource to a specific path inside the container, returning the container itself.
 T addAsWebInfResource(Package resourcePackage, String resourceName, String target)
          Adds the resource as a WEB-INF resource to a specific path inside the container, returning the container itself.
 T addAsWebInfResource(String resourceName)
          Adds the resource as a WEB-INF resource to the container, returning the container itself.
 T addAsWebInfResource(String resourceName, ArchivePath target)
          Adds the resource as a WEB-INF resource to the container, returning the container itself.
 T addAsWebInfResource(String resourceName, String target)
          Adds the resource as a WEB-INF resource to the container, returning the container itself.
 T addAsWebInfResource(URL resource, ArchivePath target)
          Adds the URL as a WEB-INF resource to the container, returning the container itself.
 T addAsWebInfResource(URL resource, String target)
          Adds the URL as a WEB-INF resource to the container, returning the container itself.
 T addAsWebInfResources(Package resourcePackage, String... resourceNames)
          Adds the resources inside the package as multiple WEB-INF resources to the container, returning the container itself.
 T addAsWebResource(Asset resource, ArchivePath target)
          Adds the Asset as a Web resource to the container, returning the container itself.
 T addAsWebResource(Asset resource, String target)
          Adds the Asset as a Web resource to the container, returning the container itself.
 T addAsWebResource(File resource)
          Adds the File as a Web resource to the container, returning the container itself.
 T addAsWebResource(File resource, ArchivePath target)
          Adds the File as a Web resource to the container, returning the container itself.
 T addAsWebResource(File resource, String target)
          Adds the File as a Web resource to the container, returning the container itself.
 T addAsWebResource(Package resourcePackage, String resourceName)
          Adds the resource as a resource to the container, returning the container itself.
 T addAsWebResource(Package resourcePackage, String resourceName, ArchivePath target)
          Adds the resource as a resource to a specific path inside the container, returning the container itself.
 T addAsWebResource(Package resourcePackage, String resourceName, String target)
          Adds the resource as a resource to a specific path inside the container, returning the container itself.
 T addAsWebResource(String resourceName)
          Adds the resource as a Web resource to the container, returning the container itself.
 T addAsWebResource(String resourceName, ArchivePath target)
          Adds the resource as a Web resource to the container, returning the container itself.
 T addAsWebResource(String resourceName, String target)
          Adds the resource as a Web resource to the container, returning the container itself.
 T addAsWebResource(URL resource, ArchivePath target)
          Adds the URL as a Web resource to the container, returning the container itself.
 T addAsWebResource(URL resource, String target)
          Adds the URL as a Web resource to the container, returning the container itself.
 T addAsWebResources(Package resourcePackage, String... resourceNames)
          Adds the resources inside the package as multiple resources to the container, returning the container itself.
 T setWebXML(Asset resource)
          Adds the Asset as web.xml to the container, returning the container itself.
 T setWebXML(File resource)
          Adds the File as web.xml to the container, returning the container itself.
 T setWebXML(Package resourcePackage, String resourceName)
          Adds the resource inside the package as web.xml to the container, returning the container itself.
 T setWebXML(String resourceName)
          Adds the resource as web.xml to the container, returning the container itself.
 T setWebXML(URL resource)
          Adds the URL as web.xml to the container, returning the container itself.
 

Method Detail

setWebXML

T setWebXML(String resourceName)
                               throws IllegalArgumentException
Adds the resource as web.xml to the container, returning the container itself.
The ClassLoader used to obtain the resource is up to the implementation.

Parameters:
resourceName - resource to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourceName is null
See Also:
setWebXML(Asset)

setWebXML

T setWebXML(File resource)
                               throws IllegalArgumentException
Adds the File as web.xml to the container, returning the container itself.

Parameters:
resource - File resource to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
See Also:
setWebXML(Asset)

setWebXML

T setWebXML(URL resource)
                               throws IllegalArgumentException
Adds the URL as web.xml to the container, returning the container itself.

Parameters:
resource - URL resource to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
See Also:
setWebXML(Asset)

setWebXML

T setWebXML(Asset resource)
                               throws IllegalArgumentException
Adds the Asset as web.xml to the container, returning the container itself.

Parameters:
resource - Asset resource to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
See Also:
addAsWebResource(Asset, ArchivePath)

setWebXML

T setWebXML(Package resourcePackage,
            String resourceName)
                               throws IllegalArgumentException
Adds the resource inside the package as web.xml to the container, returning the container itself.

The ClassLoader used to obtain the resource is up to the implementation.

Parameters:
resourcePackage - The package of the resources
resourceName - The name of the resources inside resourcePackage
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourcePackage is null
IllegalArgumentException - if resourceName is null

addAsWebResource

T addAsWebResource(String resourceName)
                                      throws IllegalArgumentException
Adds the resource as a Web resource to the container, returning the container itself.
The resource will be placed into the Container Web path under the same context from which it was retrieved.

The ClassLoader used to obtain the resource is up to the implementation.

Parameters:
resourceName - resource to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourceName is null
IllegalArgumentException - if target is null
See Also:
addAsWebResource(Asset, ArchivePath)

addAsWebResource

T addAsWebResource(File resource)
                                      throws IllegalArgumentException
Adds the File as a Web resource to the container, returning the container itself.
The File will be placed into the Container Web path under File.getName().

Parameters:
resource - resource to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - if File resource is null
IllegalArgumentException - if target is null
See Also:
addAsWebResource(Asset, ArchivePath)

addAsWebResource

T addAsWebResource(String resourceName,
                   String target)
                                      throws IllegalArgumentException
Adds the resource as a Web resource to the container, returning the container itself.
The ClassLoader used to obtain the resource is up to the implementation.

Parameters:
resourceName - resource to add
target - The target path within the archive in which to add the resource, relative to the Archives web path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourceName is null
IllegalArgumentException - if target is null
See Also:
addAsWebResource(Asset, ArchivePath)

addAsWebResource

T addAsWebResource(File resource,
                   String target)
                                      throws IllegalArgumentException
Adds the File as a Web resource to the container, returning the container itself.

Parameters:
resource - File resource to add
target - The target path within the archive in which to add the resource, relative to the Archives web path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
IllegalArgumentException - if target is null
See Also:
addAsWebResource(Asset, ArchivePath)

addAsWebResource

T addAsWebResource(URL resource,
                   String target)
                                      throws IllegalArgumentException
Adds the URL as a Web resource to the container, returning the container itself.

Parameters:
resource - URL resource to add
target - The target path within the archive in which to add the resource, relative to the Archives web path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
IllegalArgumentException - if target is null
See Also:
addAsWebResource(Asset, ArchivePath)

addAsWebResource

T addAsWebResource(Asset resource,
                   String target)
                                      throws IllegalArgumentException
Adds the Asset as a Web resource to the container, returning the container itself.

Parameters:
resource - Asset resource to add
target - The target path within the archive in which to add the resource, relative to the Archives web path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
IllegalArgumentException - if target is null
See Also:
addAsWebResource(Asset, ArchivePath)

addAsWebResource

T addAsWebResource(String resourceName,
                   ArchivePath target)
                                      throws IllegalArgumentException
Adds the resource as a Web resource to the container, returning the container itself.


The ClassLoader used to obtain the resource is up to the implementation.

Parameters:
resourceName - resource to add
target - The target path within the archive in which to add the resource, relative to the Archives web path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourceName is null
IllegalArgumentException - if target is null
See Also:
addAsWebResource(Asset, ArchivePath)

addAsWebResource

T addAsWebResource(File resource,
                   ArchivePath target)
                                      throws IllegalArgumentException
Adds the File as a Web resource to the container, returning the container itself.

Parameters:
resource - File resource to add
target - The target path within the archive in which to add the resource, relative to the Archives web path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
IllegalArgumentException - if target is null
See Also:
addAsWebResource(Asset, ArchivePath)

addAsWebResource

T addAsWebResource(URL resource,
                   ArchivePath target)
                                      throws IllegalArgumentException
Adds the URL as a Web resource to the container, returning the container itself.

Parameters:
resource - URL resource to add
target - The target path within the archive in which to add the resource, relative to the Archives web path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
IllegalArgumentException - if target is null
See Also:
addAsWebResource(Asset, ArchivePath)

addAsWebResource

T addAsWebResource(Asset resource,
                   ArchivePath target)
                                      throws IllegalArgumentException
Adds the Asset as a Web resource to the container, returning the container itself.

Parameters:
resource - Asset resource to add
target - The target path within the archive in which to add the resource, relative to the Archives web path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
IllegalArgumentException - if target is null

addAsWebResources

T addAsWebResources(Package resourcePackage,
                    String... resourceNames)
                                       throws IllegalArgumentException
Adds the resources inside the package as multiple resources to the container, returning the container itself.

The ClassLoader used to obtain the resource is up to the implementation.

Parameters:
resourcePackage - The package of the resources
resourceNames - The names of the resources inside resoucePackage
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourcePackage is null
IllegalArgumentException - if no resourceNames are specified or containing null

addAsWebResource

T addAsWebResource(Package resourcePackage,
                   String resourceName)
                                      throws IllegalArgumentException
Adds the resource as a resource to the container, returning the container itself.

The ClassLoader used to obtain the resource is up to the implementation.

Parameters:
resourcePackage - The package of the resource
resourceName - The name of the resource inside resoucePackage
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourcePackage is null
IllegalArgumentException - if resourceName is null

addAsWebResource

T addAsWebResource(Package resourcePackage,
                   String resourceName,
                   String target)
                                      throws IllegalArgumentException
Adds the resource as a resource to a specific path inside the container, returning the container itself.

The ClassLoader used to obtain the resource is up to the implementation.

Parameters:
resourcePackage - The package of the resource
resourceName - The name of the resource inside resoucePackage
target - The target location inside the container
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourcePackage is null
IllegalArgumentException - if resourceName is null
IllegalArgumentException - if target is null

addAsWebResource

T addAsWebResource(Package resourcePackage,
                   String resourceName,
                   ArchivePath target)
                                      throws IllegalArgumentException
Adds the resource as a resource to a specific path inside the container, returning the container itself.

The ClassLoader used to obtain the resource is up to the implementation.

Parameters:
resourcePackage - The package of the resource
resourceName - The name of the resource inside resoucePackage
target - The target location inside the container
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourcePackage is null
IllegalArgumentException - if resourceName is null
IllegalArgumentException - if target is null

addAsWebInfResource

T addAsWebInfResource(String resourceName)
                                         throws IllegalArgumentException
Adds the resource as a WEB-INF resource to the container, returning the container itself.

The ClassLoader used to obtain the resource is up to the implementation.

Parameters:
resourceName - resource to add
Returns:
This Archive
Throws:
IllegalArgumentException - if resourceName is not specified

addAsWebInfResource

T addAsWebInfResource(File resource)
                                         throws IllegalArgumentException
Adds the File as a WEB-INF resource to the container, returning the container itself.
The File will be placed into the Container WEB-INF path under File.getName().

Parameters:
resource - Resource to add
Returns:
This Archive
Throws:
IllegalArgumentException - if File resource is null

addAsWebInfResource

T addAsWebInfResource(String resourceName,
                      String target)
                                         throws IllegalArgumentException
Adds the resource as a WEB-INF resource to the container, returning the container itself.
The ClassLoader used to obtain the resource is up to the implementation.

Parameters:
resourceName - resource to add
target - The target path within the archive in which to add the resource, relative to the Archives WEB-INF path.
Returns:
This Archive
Throws:
IllegalArgumentException - if resourceName or target is not specified

addAsWebInfResource

T addAsWebInfResource(File resource,
                      String target)
                                         throws IllegalArgumentException
Adds the File as a WEB-INF resource to the container, returning the container itself.

Parameters:
resource - File resource to add
target - The target path within the archive in which to add the resource, relative to the Archives WEB-INF path.
Returns:
This Archive
Throws:
IllegalArgumentException - If the resource or target is not specified

addAsWebInfResource

T addAsWebInfResource(URL resource,
                      String target)
                                         throws IllegalArgumentException
Adds the URL as a WEB-INF resource to the container, returning the container itself.

Parameters:
resource - URL resource to add
target - The target path within the archive in which to add the resource, relative to the Archives WEB-INF path.
Returns:
This Archive
Throws:
IllegalArgumentException - If the resource or target is not specified

addAsWebInfResource

T addAsWebInfResource(Asset resource,
                      String target)
                                         throws IllegalArgumentException
Adds the Asset as a WEB-INF resource to the container, returning the container itself.

Parameters:
resource - Asset resource to add
target - The target path within the archive in which to add the resource, relative to the Archives WEB-INF path.
Returns:
This Archive
Throws:
IllegalArgumentException - If the resource or target is not specified

addAsWebInfResource

T addAsWebInfResource(String resourceName,
                      ArchivePath target)
                                         throws IllegalArgumentException
Adds the resource as a WEB-INF resource to the container, returning the container itself.

The ClassLoader used to obtain the resource is up to the implementation.

Parameters:
resourceName - resource to add
target - The target path within the archive in which to add the resource, relative to the Archives WEB-INF path.
Returns:
This Archive
Throws:
IllegalArgumentException - If the resource or target is not specified

addAsWebInfResource

T addAsWebInfResource(File resource,
                      ArchivePath target)
                                         throws IllegalArgumentException
Adds the File as a WEB-INF resource to the container, returning the container itself.

Parameters:
resource - File resource to add
target - The target path within the archive in which to add the resource, relative to the Archives WEB-INF path.
Returns:
This Archive
Throws:
IllegalArgumentException - If the resource or target is not specified

addAsWebInfResource

T addAsWebInfResource(URL resource,
                      ArchivePath target)
                                         throws IllegalArgumentException
Adds the URL as a WEB-INF resource to the container, returning the container itself.

Parameters:
resource - URL resource to add
target - The target path within the archive in which to add the resource, relative to the Archives WEB-INF path.
Returns:
This Archive
Throws:
IllegalArgumentException - If the resource or target is not specified

addAsWebInfResource

T addAsWebInfResource(Asset resource,
                      ArchivePath target)
                                         throws IllegalArgumentException
Adds the Asset as a WEB-INF resource to the container, returning the container itself.

Parameters:
resource - Asset resource to add
target - The target path within the archive in which to add the resource, relative to the Archives WEB-INF path.
Returns:
This Archive
Throws:
IllegalArgumentException - If the resource or target is not specified

addAsWebInfResources

T addAsWebInfResources(Package resourcePackage,
                       String... resourceNames)
                                          throws IllegalArgumentException
Adds the resources inside the package as multiple WEB-INF resources to the container, returning the container itself.

The ClassLoader used to obtain the resource is up to the implementation.

Parameters:
resourcePackage - The package of the resources
resourceNames - The names of the resources inside resourcePackage
Returns:
This Archive
Throws:
IllegalArgumentException - If resourcePackage is null, or if no resourceNames are specified or containing null

addAsWebInfResource

T addAsWebInfResource(Package resourcePackage,
                      String resourceName)
                                         throws IllegalArgumentException
Adds the resource as a WEB-INF resource to the container, returning the container itself.

The ClassLoader used to obtain the resource is up to the implementation.

Parameters:
resourcePackage - The package of the resource
resourceName - The name of the resource inside resourcePackage
Returns:
This Archive
Throws:
IllegalArgumentException - If the package or resource name is not specified

addAsWebInfResource

T addAsWebInfResource(Package resourcePackage,
                      String resourceName,
                      String target)
                                         throws IllegalArgumentException
Adds the resource as a WEB-INF resource to a specific path inside the container, returning the container itself.

The ClassLoader used to obtain the resource is up to the implementation.

Parameters:
resourcePackage - The package of the resource
resourceName - The name of the resource inside resoucePackage
target - The target location inside the container
Returns:
This Archive
Throws:
IllegalArgumentException - If the package, resource name, or target is not specified

addAsWebInfResource

T addAsWebInfResource(Package resourcePackage,
                      String resourceName,
                      ArchivePath target)
                                         throws IllegalArgumentException
Adds the resource as a WEB-INF resource to a specific path inside the container, returning the container itself.

The ClassLoader used to obtain the resource is up to the implementation.

Parameters:
resourcePackage - The package of the resource
resourceName - The name of the resource inside resoucePackage
target - The target location inside the container
Returns:
This Archive
Throws:
IllegalArgumentException - If the package, resource name, or target is not specified


Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.