Class WebContainerBase<T extends Archive<T>>
- java.lang.Object
-
- org.jboss.shrinkwrap.impl.base.AssignableBase<Archive<?>>
-
- org.jboss.shrinkwrap.impl.base.container.ContainerBase<T>
-
- org.jboss.shrinkwrap.impl.base.container.WebContainerBase<T>
-
- Type Parameters:
T-
- All Implemented Interfaces:
Archive<T>,Assignable,ClassContainer<T>,LibraryContainer<T>,ManifestContainer<T>,ResourceContainer<T>,ServiceProviderContainer<T>,WebContainer<T>,ArchiveFormatAssociable
- Direct Known Subclasses:
WebArchiveImpl
public abstract class WebContainerBase<T extends Archive<T>> extends ContainerBase<T> implements WebContainer<T>
WebContainerBase Abstract class that helps implement the WebContainer. Used by specs that extends the WebContainer.- Version:
- $Revision: $
-
-
Field Summary
-
Fields inherited from interface org.jboss.shrinkwrap.api.container.ManifestContainer
DEFAULT_MANIFEST_NAME
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedWebContainerBase(java.lang.Class<T> actualType, Archive<?> archive)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description TaddAsServiceProvider(java.lang.Class<?> serviceInterface, java.lang.Class<?>... serviceImpls)Adds a META-INF/services/ServiceInterfaceNameAssetrepresenting this service.TaddAsServiceProvider(java.lang.String serviceInterface, java.lang.String... serviceImpls)Adds a META-INF/services/ServiceInterfaceNameAssetrepresenting this service.TaddAsServiceProviderAndClasses(java.lang.Class<?> serviceInterface, java.lang.Class<?>... serviceImpls)Adds a META-INF/services/ServiceInterfaceNameAssetand the classes related to the service to the archive.TaddAsWebInfResource(java.io.File resource)Adds theFileas a WEB-INF resource to the container, returning the container itself.TaddAsWebInfResource(java.io.File resource, java.lang.String target)Adds theFileas a WEB-INF resource to the container, returning the container itself.TaddAsWebInfResource(java.io.File resource, ArchivePath target)Adds theFileas a WEB-INF resource to the container, returning the container itself.TaddAsWebInfResource(java.lang.Package resourcePackage, java.lang.String resourceName)Adds the resource as a WEB-INF resource to the container, returning the container itself.TaddAsWebInfResource(java.lang.Package resourcePackage, java.lang.String resourceName, java.lang.String target)Adds the resource as a WEB-INF resource to a specific path inside the container, returning the container itself.TaddAsWebInfResource(java.lang.Package resourcePackage, java.lang.String resourceName, ArchivePath target)Adds the resource as a WEB-INF resource to a specific path inside the container, returning the container itself.TaddAsWebInfResource(java.lang.String resourceName)Adds the resource as a WEB-INF resource to the container, returning the container itself.TaddAsWebInfResource(java.lang.String resourceName, java.lang.String target)Adds the resource as a WEB-INF resource to the container, returning the container itself.TaddAsWebInfResource(java.lang.String resourceName, ArchivePath target)Adds the resource as a WEB-INF resource to the container, returning the container itself.TaddAsWebInfResource(java.net.URL resource, java.lang.String target)Adds theURLas a WEB-INF resource to the container, returning the container itself.TaddAsWebInfResource(java.net.URL resource, ArchivePath target)Adds theURLas a WEB-INF resource to the container, returning the container itself.TaddAsWebInfResource(Asset resource, java.lang.String target)Adds theAssetas a WEB-INF resource to the container, returning the container itself.TaddAsWebInfResource(Asset resource, ArchivePath target)Adds theAssetas a WEB-INF resource to the container, returning the container itself.TaddAsWebInfResources(java.lang.Package resourcePackage, java.lang.String... resourceNames)Adds the resources inside the package as multiple WEB-INF resources to the container, returning the container itself.TaddAsWebResource(java.io.File resource)Adds theFileas a Web resource to the container, returning the container itself.TaddAsWebResource(java.io.File resource, java.lang.String target)Adds theFileas a Web resource to the container, returning the container itself.TaddAsWebResource(java.io.File resource, ArchivePath target)Adds theFileas a Web resource to the container, returning the container itself.TaddAsWebResource(java.lang.Package resourcePackage, java.lang.String resourceName)Adds the resource as a resource to the container, returning the container itself.TaddAsWebResource(java.lang.Package resourcePackage, java.lang.String resourceName, java.lang.String target)Adds the resource as a resource to a specific path inside the container, returning the container itself.TaddAsWebResource(java.lang.Package resourcePackage, java.lang.String resourceName, ArchivePath target)Adds the resource as a resource to a specific path inside the container, returning the container itself.TaddAsWebResource(java.lang.String resourceName)Adds the resource as a Web resource to the container, returning the container itself.TaddAsWebResource(java.lang.String resourceName, java.lang.String target)Adds the resource as a Web resource to the container, returning the container itself.TaddAsWebResource(java.lang.String resourceName, ArchivePath target)Adds the resource as a Web resource to the container, returning the container itself.TaddAsWebResource(java.net.URL resource, java.lang.String target)Adds theURLas a Web resource to the container, returning the container itself.TaddAsWebResource(java.net.URL resource, ArchivePath target)Adds theURLas a Web resource to the container, returning the container itself.TaddAsWebResource(Asset resource, java.lang.String target)Adds theAssetas a Web resource to the container, returning the container itself.TaddAsWebResource(Asset resource, ArchivePath target)Adds theAssetas a Web resource to the container, returning the container itself.TaddAsWebResources(java.lang.Package resourcePackage, java.lang.String... resourceNames)Adds the resources inside the package as multiple resources to the container, returning the container itself.protected abstract ArchivePathgetServiceProvidersPath()Returns the path to web container service providersprotected abstract ArchivePathgetWebInfPath()Returns the path to WEB-INFprotected abstract ArchivePathgetWebPath()Returns the path to web resourcesTsetWebXML(java.io.File resource)Adds theFileas web.xml to the container, returning the container itself.TsetWebXML(java.lang.Package resourcePackage, java.lang.String resourceName)Adds the resource inside the package as web.xml to the container, returning the container itself.TsetWebXML(java.lang.String resourceName)Adds the resource as web.xml to the container, returning the container itself.TsetWebXML(java.net.URL resource)Adds theURLas web.xml to the container, returning the container itself.TsetWebXML(Asset resource)Adds theAssetas web.xml to the container, returning the container itself.-
Methods inherited from class org.jboss.shrinkwrap.impl.base.container.ContainerBase
add, add, add, add, add, add, add, addAsDirectories, addAsDirectories, addAsDirectory, addAsDirectory, addAsLibraries, addAsLibraries, addAsLibraries, addAsLibraries, addAsLibraries, addAsLibrary, addAsLibrary, addAsLibrary, addAsLibrary, addAsLibrary, addAsLibrary, addAsLibrary, addAsLibrary, addAsLibrary, addAsLibrary, addAsLibrary, addAsManifestResource, addAsManifestResource, addAsManifestResource, addAsManifestResource, addAsManifestResource, addAsManifestResource, addAsManifestResource, addAsManifestResource, addAsManifestResource, addAsManifestResource, addAsManifestResource, addAsManifestResource, addAsManifestResource, addAsManifestResources, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResources, addClass, addClass, addClass, addClasses, addDefaultPackage, addHandlers, addManifest, addPackage, addPackage, addPackages, addPackages, addPackages, addPackages, contains, contains, covarientReturn, delete, delete, deleteClass, deleteClass, deleteClasses, deleteDefaultPackage, deletePackage, deletePackage, deletePackages, deletePackages, deletePackages, deletePackages, equals, filter, get, get, getActualClass, getArchiveFormat, getAsType, getAsType, getAsType, getAsType, getAsType, getAsType, getClassesPath, getContent, getContent, getId, getLibraryPath, getManifestPath, getName, getResourcePath, hashCode, merge, merge, merge, merge, merge, merge, move, move, setManifest, setManifest, setManifest, setManifest, setManifest, shallowCopy, shallowCopy, toString, toString, toString, writeTo
-
Methods inherited from class org.jboss.shrinkwrap.impl.base.AssignableBase
as, getArchive
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jboss.shrinkwrap.api.Assignable
as
-
-
-
-
Method Detail
-
getWebPath
protected abstract ArchivePath getWebPath()
Returns the path to web resources- Returns:
- Base Path for the web resources
-
getWebInfPath
protected abstract ArchivePath getWebInfPath()
Returns the path to WEB-INF- Returns:
- the path to WEB-INF
-
getServiceProvidersPath
protected abstract ArchivePath getServiceProvidersPath()
Returns the path to web container service providers- Returns:
- the path to web container service providers
-
setWebXML
public T setWebXML(java.lang.String resourceName) throws java.lang.IllegalArgumentException
Description copied from interface:WebContainerAdds the resource as web.xml to the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
setWebXMLin interfaceWebContainer<T extends Archive<T>>- Parameters:
resourceName- resource to add- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resourceName is null- See Also:
WebContainer.setWebXML(Asset)
-
setWebXML
public T setWebXML(java.io.File resource) throws java.lang.IllegalArgumentException
Description copied from interface:WebContainerAdds theFileas web.xml to the container, returning the container itself.- Specified by:
setWebXMLin interfaceWebContainer<T extends Archive<T>>- Parameters:
resource-Fileresource to add- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resource is null- See Also:
WebContainer.setWebXML(Asset)
-
setWebXML
public T setWebXML(java.net.URL resource) throws java.lang.IllegalArgumentException
Description copied from interface:WebContainerAdds theURLas web.xml to the container, returning the container itself.- Specified by:
setWebXMLin interfaceWebContainer<T extends Archive<T>>- Parameters:
resource-URLresource to add- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resource is null- See Also:
WebContainer.setWebXML(Asset)
-
setWebXML
public T setWebXML(Asset resource) throws java.lang.IllegalArgumentException
Description copied from interface:WebContainerAdds theAssetas web.xml to the container, returning the container itself.
-
setWebXML
public T setWebXML(java.lang.Package resourcePackage, java.lang.String resourceName) throws java.lang.IllegalArgumentException
Description copied from interface:WebContainerAdds the resource inside the package as web.xml to the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
setWebXMLin interfaceWebContainer<T extends Archive<T>>- Parameters:
resourcePackage- The package of the resourcesresourceName- The name of the resources inside resourcePackage- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resourcePackage is null
-
addAsWebResource
public T addAsWebResource(java.lang.String resourceName) throws java.lang.IllegalArgumentException
Description copied from interface:WebContainerAdds 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.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsWebResourcein interfaceWebContainer<T extends Archive<T>>- Parameters:
resourceName- resource to add- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resourceName is null- See Also:
WebContainer.addAsWebResource(Asset, ArchivePath)
-
addAsWebResource
public T addAsWebResource(java.io.File resource) throws java.lang.IllegalArgumentException
Description copied from interface:WebContainerAdds theFileas a Web resource to the container, returning the container itself.
TheFilewill be placed into the Container Web path underFile.getName().- Specified by:
addAsWebResourcein interfaceWebContainer<T extends Archive<T>>- Parameters:
resource- resource to add- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- ifFileresource is null- See Also:
WebContainer.addAsWebResource(Asset, ArchivePath)
-
addAsWebResource
public T addAsWebResource(java.lang.String resourceName, java.lang.String target) throws java.lang.IllegalArgumentException
Description copied from interface:WebContainerAdds the resource as a Web resource to the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsWebResourcein interfaceWebContainer<T extends Archive<T>>- Parameters:
resourceName- resource to addtarget- The target path within the archive in which to add the resource, relative to theArchives web path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resourceName is null- See Also:
WebContainer.addAsWebResource(Asset, ArchivePath)
-
addAsWebResource
public T addAsWebResource(java.io.File resource, java.lang.String target) throws java.lang.IllegalArgumentException
Description copied from interface:WebContainerAdds theFileas a Web resource to the container, returning the container itself.- Specified by:
addAsWebResourcein interfaceWebContainer<T extends Archive<T>>- Parameters:
resource-Fileresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives web path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resource is null- See Also:
WebContainer.addAsWebResource(Asset, ArchivePath)
-
addAsWebResource
public T addAsWebResource(java.net.URL resource, java.lang.String target) throws java.lang.IllegalArgumentException
Description copied from interface:WebContainerAdds theURLas a Web resource to the container, returning the container itself.- Specified by:
addAsWebResourcein interfaceWebContainer<T extends Archive<T>>- Parameters:
resource-URLresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives web path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resource is null- See Also:
WebContainer.addAsWebResource(Asset, ArchivePath)
-
addAsWebResource
public T addAsWebResource(Asset resource, java.lang.String target) throws java.lang.IllegalArgumentException
Description copied from interface:WebContainerAdds theAssetas a Web resource to the container, returning the container itself.- Specified by:
addAsWebResourcein interfaceWebContainer<T extends Archive<T>>- Parameters:
resource-Assetresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives web path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resource is null- See Also:
WebContainer.addAsWebResource(Asset, ArchivePath)
-
addAsWebResource
public T addAsWebResource(java.lang.String resourceName, ArchivePath target) throws java.lang.IllegalArgumentException
Description copied from interface:WebContainerAdds the resource as a Web resource to the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsWebResourcein interfaceWebContainer<T extends Archive<T>>- Parameters:
resourceName- resource to addtarget- The target path within the archive in which to add the resource, relative to theArchives web path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resourceName is null- See Also:
WebContainer.addAsWebResource(Asset, ArchivePath)
-
addAsWebResource
public T addAsWebResource(java.io.File resource, ArchivePath target) throws java.lang.IllegalArgumentException
Adds theFileas a Web resource to the container, returning the container itself.- Specified by:
addAsWebResourcein interfaceWebContainer<T extends Archive<T>>- Parameters:
resource-Fileresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives web path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resource is null- See Also:
WebContainer.addAsWebResource(java.io.File, org.jboss.shrinkwrap.api.ArchivePath)
-
addAsWebResource
public T addAsWebResource(java.net.URL resource, ArchivePath target) throws java.lang.IllegalArgumentException
Description copied from interface:WebContainerAdds theURLas a Web resource to the container, returning the container itself.- Specified by:
addAsWebResourcein interfaceWebContainer<T extends Archive<T>>- Parameters:
resource-URLresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives web path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resource is null- See Also:
WebContainer.addAsWebResource(Asset, ArchivePath)
-
addAsWebResource
public T addAsWebResource(Asset resource, ArchivePath target) throws java.lang.IllegalArgumentException
Adds theAssetas a Web resource to the container, returning the container itself.- Specified by:
addAsWebResourcein interfaceWebContainer<T extends Archive<T>>- Parameters:
resource-Assetresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives web path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resource is null- See Also:
WebContainer.addAsWebResource(org.jboss.shrinkwrap.api.asset.Asset, org.jboss.shrinkwrap.api.ArchivePath)
-
addAsWebResources
public T addAsWebResources(java.lang.Package resourcePackage, java.lang.String... resourceNames) throws java.lang.IllegalArgumentException
Adds the resources inside the package as multiple resources to the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsWebResourcesin interfaceWebContainer<T extends Archive<T>>- Parameters:
resourcePackage- The package of the resourcesresourceNames- The names of the resources inside resoucePackage- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resourcePackage is null- See Also:
WebContainer.addAsWebResources(java.lang.Package, java.lang.String[])
-
addAsWebResource
public T addAsWebResource(java.lang.Package resourcePackage, java.lang.String resourceName) throws java.lang.IllegalArgumentException
Description copied from interface:WebContainerAdds the resource as a resource to the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsWebResourcein interfaceWebContainer<T extends Archive<T>>- Parameters:
resourcePackage- The package of the resourceresourceName- The name of the resource inside resoucePackage- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resourcePackage is null
-
addAsWebResource
public T addAsWebResource(java.lang.Package resourcePackage, java.lang.String resourceName, java.lang.String target) throws java.lang.IllegalArgumentException
Description copied from interface:WebContainerAdds the resource as a resource to a specific path inside the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsWebResourcein interfaceWebContainer<T extends Archive<T>>- Parameters:
resourcePackage- The package of the resourceresourceName- The name of the resource inside resoucePackagetarget- The target location inside the container- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resourcePackage is null
-
addAsWebResource
public T addAsWebResource(java.lang.Package resourcePackage, java.lang.String resourceName, ArchivePath target) throws java.lang.IllegalArgumentException
Description copied from interface:WebContainerAdds the resource as a resource to a specific path inside the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsWebResourcein interfaceWebContainer<T extends Archive<T>>- Parameters:
resourcePackage- The package of the resourceresourceName- The name of the resource inside resoucePackagetarget- The target location inside the container- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resourcePackage is null
-
addAsWebInfResource
public T addAsWebInfResource(java.lang.String resourceName) throws java.lang.IllegalArgumentException
Adds the resource as a WEB-INF resource to the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsWebInfResourcein interfaceWebContainer<T extends Archive<T>>- Parameters:
resourceName- resource to add- Returns:
- This
Archive - Throws:
java.lang.IllegalArgumentException- if resourceName is not specified- See Also:
WebContainer.addAsWebInfResource(java.lang.String)
-
addAsWebInfResource
public T addAsWebInfResource(java.io.File resource) throws java.lang.IllegalArgumentException
Adds theFileas a WEB-INF resource to the container, returning the container itself.
TheFilewill be placed into the Container WEB-INF path underFile.getName().- Specified by:
addAsWebInfResourcein interfaceWebContainer<T extends Archive<T>>- Parameters:
resource- Resource to add- Returns:
- This
Archive - Throws:
java.lang.IllegalArgumentException- ifFileresource is null- See Also:
WebContainer.addAsWebInfResource(java.io.File)
-
addAsWebInfResource
public T addAsWebInfResource(java.lang.String resourceName, java.lang.String target) throws java.lang.IllegalArgumentException
Adds the resource as a WEB-INF resource to the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsWebInfResourcein interfaceWebContainer<T extends Archive<T>>- Parameters:
resourceName- resource to addtarget- The target path within the archive in which to add the resource, relative to theArchives WEB-INF path.- Returns:
- This
Archive - Throws:
java.lang.IllegalArgumentException- if resourceName or target is not specified- See Also:
WebContainer.addAsWebInfResource(java.lang.String, java.lang.String)
-
addAsWebInfResource
public T addAsWebInfResource(java.io.File resource, java.lang.String target) throws java.lang.IllegalArgumentException
Adds theFileas a WEB-INF resource to the container, returning the container itself.- Specified by:
addAsWebInfResourcein interfaceWebContainer<T extends Archive<T>>- Parameters:
resource-Fileresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives WEB-INF path.- Returns:
- This
Archive - Throws:
java.lang.IllegalArgumentException- If the resource or target is not specified- See Also:
WebContainer.addAsWebInfResource(java.io.File, java.lang.String)
-
addAsWebInfResource
public T addAsWebInfResource(java.net.URL resource, java.lang.String target) throws java.lang.IllegalArgumentException
Adds theURLas a WEB-INF resource to the container, returning the container itself.- Specified by:
addAsWebInfResourcein interfaceWebContainer<T extends Archive<T>>- Parameters:
resource-URLresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives WEB-INF path.- Returns:
- This
Archive - Throws:
java.lang.IllegalArgumentException- If the resource or target is not specified- See Also:
WebContainer.addAsWebInfResource(java.net.URL, java.lang.String)
-
addAsWebInfResource
public T addAsWebInfResource(Asset resource, java.lang.String target) throws java.lang.IllegalArgumentException
Adds theAssetas a WEB-INF resource to the container, returning the container itself.- Specified by:
addAsWebInfResourcein interfaceWebContainer<T extends Archive<T>>- Parameters:
resource-Assetresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives WEB-INF path.- Returns:
- This
Archive - Throws:
java.lang.IllegalArgumentException- If the resource or target is not specified- See Also:
WebContainer.addAsWebInfResource(org.jboss.shrinkwrap.api.asset.Asset, java.lang.String)
-
addAsWebInfResource
public T addAsWebInfResource(java.lang.String resourceName, ArchivePath target) throws java.lang.IllegalArgumentException
Adds the resource as a WEB-INF resource to the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsWebInfResourcein interfaceWebContainer<T extends Archive<T>>- Parameters:
resourceName- resource to addtarget- The target path within the archive in which to add the resource, relative to theArchives WEB-INF path.- Returns:
- This
Archive - Throws:
java.lang.IllegalArgumentException- If the resource or target is not specified- See Also:
WebContainer.addAsWebInfResource(java.lang.String, org.jboss.shrinkwrap.api.ArchivePath)
-
addAsWebInfResource
public T addAsWebInfResource(java.io.File resource, ArchivePath target) throws java.lang.IllegalArgumentException
Adds theFileas a WEB-INF resource to the container, returning the container itself.- Specified by:
addAsWebInfResourcein interfaceWebContainer<T extends Archive<T>>- Parameters:
resource-Fileresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives WEB-INF path.- Returns:
- This
Archive - Throws:
java.lang.IllegalArgumentException- If the resource or target is not specified- See Also:
WebContainer.addAsWebInfResource(java.io.File, org.jboss.shrinkwrap.api.ArchivePath)
-
addAsWebInfResource
public T addAsWebInfResource(java.net.URL resource, ArchivePath target) throws java.lang.IllegalArgumentException
Adds theURLas a WEB-INF resource to the container, returning the container itself.- Specified by:
addAsWebInfResourcein interfaceWebContainer<T extends Archive<T>>- Parameters:
resource-URLresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives WEB-INF path.- Returns:
- This
Archive - Throws:
java.lang.IllegalArgumentException- If the resource or target is not specified- See Also:
WebContainer.addAsWebInfResource(java.net.URL, org.jboss.shrinkwrap.api.ArchivePath)
-
addAsWebInfResource
public T addAsWebInfResource(Asset resource, ArchivePath target) throws java.lang.IllegalArgumentException
Adds theAssetas a WEB-INF resource to the container, returning the container itself.- Specified by:
addAsWebInfResourcein interfaceWebContainer<T extends Archive<T>>- Parameters:
resource-Assetresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives WEB-INF path.- Returns:
- This
Archive - Throws:
java.lang.IllegalArgumentException- If the resource or target is not specified- See Also:
WebContainer.addAsWebInfResource(org.jboss.shrinkwrap.api.asset.Asset, org.jboss.shrinkwrap.api.ArchivePath)
-
addAsWebInfResources
public T addAsWebInfResources(java.lang.Package resourcePackage, java.lang.String... resourceNames) throws java.lang.IllegalArgumentException
Adds the resources inside the package as multiple WEB-INF resources to the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsWebInfResourcesin interfaceWebContainer<T extends Archive<T>>- Parameters:
resourcePackage- The package of the resourcesresourceNames- The names of the resources inside resourcePackage- Returns:
- This
Archive - Throws:
java.lang.IllegalArgumentException- If resourcePackage is null, or if no resourceNames are specified or containing null- See Also:
WebContainer.addAsWebInfResources(java.lang.Package, java.lang.String[])
-
addAsWebInfResource
public T addAsWebInfResource(java.lang.Package resourcePackage, java.lang.String resourceName) throws java.lang.IllegalArgumentException
Adds the resource as a WEB-INF resource to the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsWebInfResourcein interfaceWebContainer<T extends Archive<T>>- Parameters:
resourcePackage- The package of the resourceresourceName- The name of the resource inside resourcePackage- Returns:
- This
Archive - Throws:
java.lang.IllegalArgumentException- If the package or resource name is not specified- See Also:
WebContainer.addAsWebInfResource(java.lang.Package, java.lang.String)
-
addAsWebInfResource
public T addAsWebInfResource(java.lang.Package resourcePackage, java.lang.String resourceName, java.lang.String target) throws java.lang.IllegalArgumentException
Adds the resource as a WEB-INF resource to a specific path inside the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsWebInfResourcein interfaceWebContainer<T extends Archive<T>>- Parameters:
resourcePackage- The package of the resourceresourceName- The name of the resource inside resoucePackagetarget- The target location inside the container- Returns:
- This
Archive - Throws:
java.lang.IllegalArgumentException- If the package, resource name, or target is not specified- See Also:
WebContainer.addAsWebInfResource(java.lang.Package, java.lang.String, java.lang.String)
-
addAsWebInfResource
public T addAsWebInfResource(java.lang.Package resourcePackage, java.lang.String resourceName, ArchivePath target) throws java.lang.IllegalArgumentException
Adds the resource as a WEB-INF resource to a specific path inside the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsWebInfResourcein interfaceWebContainer<T extends Archive<T>>- Parameters:
resourcePackage- The package of the resourceresourceName- The name of the resource inside resoucePackagetarget- The target location inside the container- Returns:
- This
Archive - Throws:
java.lang.IllegalArgumentException- If the package, resource name, or target is not specified- See Also:
WebContainer.addAsWebInfResource(java.lang.Package, java.lang.String, org.jboss.shrinkwrap.api.ArchivePath)
-
addAsServiceProvider
public T addAsServiceProvider(java.lang.Class<?> serviceInterface, java.lang.Class<?>... serviceImpls) throws java.lang.IllegalArgumentException
Description copied from interface:ManifestContainerAdds a META-INF/services/ServiceInterfaceNameAssetrepresenting this service. Warning: this method does not add the specified classes to the archive.- Specified by:
addAsServiceProviderin interfaceManifestContainer<T extends Archive<T>>- Overrides:
addAsServiceProviderin classContainerBase<T extends Archive<T>>- Parameters:
serviceInterface- The Service Interface classserviceImpls- The Service Interface Implementations- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if serviceInterface is null
-
addAsServiceProvider
public T addAsServiceProvider(java.lang.String serviceInterface, java.lang.String... serviceImpls) throws java.lang.IllegalArgumentException
Description copied from interface:ManifestContainerAdds a META-INF/services/ServiceInterfaceNameAssetrepresenting this service.- Specified by:
addAsServiceProviderin interfaceManifestContainer<T extends Archive<T>>- Overrides:
addAsServiceProviderin classContainerBase<T extends Archive<T>>- Parameters:
serviceInterface- The Service Interface class nameserviceImpls- The Service Interface Implementations class names- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if serviceInterface is null- See Also:
ManifestContainer.addAsServiceProvider(Class, Class...)
-
addAsServiceProviderAndClasses
public T addAsServiceProviderAndClasses(java.lang.Class<?> serviceInterface, java.lang.Class<?>... serviceImpls) throws java.lang.IllegalArgumentException
Description copied from interface:ServiceProviderContainerAdds a META-INF/services/ServiceInterfaceNameAssetand the classes related to the service to the archive.- Specified by:
addAsServiceProviderAndClassesin interfaceServiceProviderContainer<T extends Archive<T>>- Overrides:
addAsServiceProviderAndClassesin classContainerBase<T extends Archive<T>>- Parameters:
serviceInterface- The Service Interface classserviceImpls- The Service Interface Implementations- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if serviceInterface is null
-
-