Interface WebContainer<T extends Archive<T>>
- Type Parameters:
T
-
- All Known Subinterfaces:
WebArchive
- All Known Implementing Classes:
WebArchiveImpl
,WebContainerBase
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.
The actual path to the Web resources within the Archive is up to the implementations/specifications.
- Version:
- $Revision: $
-
Method Summary
Modifier and TypeMethodDescriptionaddAsWebInfResource
(File resource) Adds theFile
as a WEB-INF resource to the container, returning the container itself.addAsWebInfResource
(File resource, String target) Adds theFile
as a WEB-INF resource to the container, returning the container itself.addAsWebInfResource
(File resource, ArchivePath target) Adds theFile
as a WEB-INF resource to the container, returning the container itself.addAsWebInfResource
(Package resourcePackage, String resourceName) Adds the resource as a WEB-INF resource to the container, returning the container itself.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.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.addAsWebInfResource
(String resourceName) Adds the resource as a WEB-INF resource to the container, returning the container itself.addAsWebInfResource
(String resourceName, String target) Adds the resource as a WEB-INF resource to the container, returning the container itself.addAsWebInfResource
(String resourceName, ArchivePath target) Adds the resource as a WEB-INF resource to the container, returning the container itself.addAsWebInfResource
(URL resource, String target) Adds theURL
as a WEB-INF resource to the container, returning the container itself.addAsWebInfResource
(URL resource, ArchivePath target) Adds theURL
as a WEB-INF resource to the container, returning the container itself.addAsWebInfResource
(Asset resource, String target) Adds theAsset
as a WEB-INF resource to the container, returning the container itself.addAsWebInfResource
(Asset resource, ArchivePath target) Adds theAsset
as a WEB-INF resource to the container, returning the container itself.addAsWebInfResources
(Package resourcePackage, String... resourceNames) Adds the resources inside the package as multiple WEB-INF resources to the container, returning the container itself.addAsWebResource
(File resource) Adds theFile
as a Web resource to the container, returning the container itself.addAsWebResource
(File resource, String target) Adds theFile
as a Web resource to the container, returning the container itself.addAsWebResource
(File resource, ArchivePath target) Adds theFile
as a Web resource to the container, returning the container itself.addAsWebResource
(Package resourcePackage, String resourceName) Adds the resource as a resource to the container, returning the container itself.addAsWebResource
(Package resourcePackage, String resourceName, String target) Adds the resource as a resource to a specific path inside the container, returning the container itself.addAsWebResource
(Package resourcePackage, String resourceName, ArchivePath target) Adds the resource as a resource to a specific path inside the container, returning the container itself.addAsWebResource
(String resourceName) Adds the resource as a Web resource to the container, returning the container itself.addAsWebResource
(String resourceName, String target) Adds the resource as a Web resource to the container, returning the container itself.addAsWebResource
(String resourceName, ArchivePath target) Adds the resource as a Web resource to the container, returning the container itself.addAsWebResource
(URL resource, String target) Adds theURL
as a Web resource to the container, returning the container itself.addAsWebResource
(URL resource, ArchivePath target) Adds theURL
as a Web resource to the container, returning the container itself.addAsWebResource
(Asset resource, String target) Adds theAsset
as a Web resource to the container, returning the container itself.addAsWebResource
(Asset resource, ArchivePath target) Adds theAsset
as a Web resource to the container, returning the container itself.addAsWebResources
(Package resourcePackage, String... resourceNames) Adds the resources inside the package as multiple resources to the container, returning the container itself.Adds theFile
as web.xml to the container, returning the container itself.Adds the resource inside the package as web.xml to the container, returning the container itself.Adds the resource as web.xml to the container, returning the container itself.Adds theURL
as web.xml to the container, returning the container itself.Adds theAsset
as web.xml to the container, returning the container itself.
-
Method Details
-
setWebXML
Adds the resource as web.xml to the container, returning the container itself.
TheClassLoader
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
Adds theFile
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
Adds theURL
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
Adds theAsset
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
-
setWebXML
Adds the resource inside the package as web.xml to the container, returning the container itself.
TheClassLoader
used to obtain the resource is up to the implementation.- Parameters:
resourcePackage
- The package of the resourcesresourceName
- The name of the resources inside resourcePackage- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resourcePackage is nullIllegalArgumentException
- if resourceName is null
-
addAsWebResource
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.
TheClassLoader
used to obtain the resource is up to the implementation.- Parameters:
resourceName
- resource to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resourceName is nullIllegalArgumentException
- if target is null- See Also:
-
addAsWebResource
Adds theFile
as a Web resource to the container, returning the container itself.
TheFile
will be placed into the Container Web path underFile.getName()
.- Parameters:
resource
- resource to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- ifFile
resource is nullIllegalArgumentException
- if target is null- See Also:
-
addAsWebResource
Adds the resource as a Web resource to the container, returning the container itself.
TheClassLoader
used to obtain the resource is up to the implementation.- Parameters:
resourceName
- resource to addtarget
- The target path within the archive in which to add the resource, relative to theArchive
s web path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resourceName is nullIllegalArgumentException
- if target is null- See Also:
-
addAsWebResource
Adds theFile
as a Web resource to the container, returning the container itself.- Parameters:
resource
-File
resource to addtarget
- The target path within the archive in which to add the resource, relative to theArchive
s web path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is nullIllegalArgumentException
- if target is null- See Also:
-
addAsWebResource
Adds theURL
as a Web resource to the container, returning the container itself.- Parameters:
resource
-URL
resource to addtarget
- The target path within the archive in which to add the resource, relative to theArchive
s web path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is nullIllegalArgumentException
- if target is null- See Also:
-
addAsWebResource
Adds theAsset
as a Web resource to the container, returning the container itself.- Parameters:
resource
-Asset
resource to addtarget
- The target path within the archive in which to add the resource, relative to theArchive
s web path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is nullIllegalArgumentException
- if target is null- See Also:
-
addAsWebResource
Adds the resource as a Web resource to the container, returning the container itself.
TheClassLoader
used to obtain the resource is up to the implementation.- Parameters:
resourceName
- resource to addtarget
- The target path within the archive in which to add the resource, relative to theArchive
s web path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resourceName is nullIllegalArgumentException
- if target is null- See Also:
-
addAsWebResource
Adds theFile
as a Web resource to the container, returning the container itself.- Parameters:
resource
-File
resource to addtarget
- The target path within the archive in which to add the resource, relative to theArchive
s web path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is nullIllegalArgumentException
- if target is null- See Also:
-
addAsWebResource
Adds theURL
as a Web resource to the container, returning the container itself.- Parameters:
resource
-URL
resource to addtarget
- The target path within the archive in which to add the resource, relative to theArchive
s web path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is nullIllegalArgumentException
- if target is null- See Also:
-
addAsWebResource
Adds theAsset
as a Web resource to the container, returning the container itself.- Parameters:
resource
-Asset
resource to addtarget
- The target path within the archive in which to add the resource, relative to theArchive
s web path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is nullIllegalArgumentException
- 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.
TheClassLoader
used to obtain the resource is up to the implementation.- Parameters:
resourcePackage
- The package of the resourcesresourceNames
- The names of the resources inside resoucePackage- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resourcePackage is nullIllegalArgumentException
- if no resourceNames are specified or containing null
-
addAsWebResource
Adds the resource as a resource to the container, returning the container itself.
TheClassLoader
used to obtain the resource is up to the implementation.- Parameters:
resourcePackage
- The package of the resourceresourceName
- The name of the resource inside resoucePackage- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resourcePackage is nullIllegalArgumentException
- 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.
TheClassLoader
used to obtain the resource is up to the implementation.- 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:
IllegalArgumentException
- if resourcePackage is nullIllegalArgumentException
- if resourceName is nullIllegalArgumentException
- 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.
TheClassLoader
used to obtain the resource is up to the implementation.- 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:
IllegalArgumentException
- if resourcePackage is nullIllegalArgumentException
- if resourceName is nullIllegalArgumentException
- if target is null
-
addAsWebInfResource
Adds the resource as a WEB-INF resource to the container, returning the container itself.
TheClassLoader
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
Adds theFile
as a WEB-INF resource to the container, returning the container itself.
TheFile
will be placed into the Container WEB-INF path underFile.getName()
.- Parameters:
resource
- Resource to add- Returns:
- This
Archive
- Throws:
IllegalArgumentException
- ifFile
resource is null
-
addAsWebInfResource
Adds the resource as a WEB-INF resource to the container, returning the container itself.
TheClassLoader
used to obtain the resource is up to the implementation.- Parameters:
resourceName
- resource to addtarget
- The target path within the archive in which to add the resource, relative to theArchive
s WEB-INF path.- Returns:
- This
Archive
- Throws:
IllegalArgumentException
- if resourceName or target is not specified
-
addAsWebInfResource
Adds theFile
as a WEB-INF resource to the container, returning the container itself.- Parameters:
resource
-File
resource to addtarget
- The target path within the archive in which to add the resource, relative to theArchive
s WEB-INF path.- Returns:
- This
Archive
- Throws:
IllegalArgumentException
- If the resource or target is not specified
-
addAsWebInfResource
Adds theURL
as a WEB-INF resource to the container, returning the container itself.- Parameters:
resource
-URL
resource to addtarget
- The target path within the archive in which to add the resource, relative to theArchive
s WEB-INF path.- Returns:
- This
Archive
- Throws:
IllegalArgumentException
- If the resource or target is not specified
-
addAsWebInfResource
Adds theAsset
as a WEB-INF resource to the container, returning the container itself.- Parameters:
resource
-Asset
resource to addtarget
- The target path within the archive in which to add the resource, relative to theArchive
s WEB-INF path.- Returns:
- This
Archive
- Throws:
IllegalArgumentException
- If the resource or target is not specified
-
addAsWebInfResource
Adds the resource as a WEB-INF resource to the container, returning the container itself.
TheClassLoader
used to obtain the resource is up to the implementation.- Parameters:
resourceName
- resource to addtarget
- The target path within the archive in which to add the resource, relative to theArchive
s WEB-INF path.- Returns:
- This
Archive
- Throws:
IllegalArgumentException
- If the resource or target is not specified
-
addAsWebInfResource
Adds theFile
as a WEB-INF resource to the container, returning the container itself.- Parameters:
resource
-File
resource to addtarget
- The target path within the archive in which to add the resource, relative to theArchive
s WEB-INF path.- Returns:
- This
Archive
- Throws:
IllegalArgumentException
- If the resource or target is not specified
-
addAsWebInfResource
Adds theURL
as a WEB-INF resource to the container, returning the container itself.- Parameters:
resource
-URL
resource to addtarget
- The target path within the archive in which to add the resource, relative to theArchive
s WEB-INF path.- Returns:
- This
Archive
- Throws:
IllegalArgumentException
- If the resource or target is not specified
-
addAsWebInfResource
Adds theAsset
as a WEB-INF resource to the container, returning the container itself.- Parameters:
resource
-Asset
resource to addtarget
- The target path within the archive in which to add the resource, relative to theArchive
s 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.
TheClassLoader
used to obtain the resource is up to the implementation.- Parameters:
resourcePackage
- The package of the resourcesresourceNames
- 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
Adds the resource as a WEB-INF resource to the container, returning the container itself.
TheClassLoader
used to obtain the resource is up to the implementation.- Parameters:
resourcePackage
- The package of the resourceresourceName
- 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.
TheClassLoader
used to obtain the resource is up to the implementation.- Parameters:
resourcePackage
- The package of the resourceresourceName
- The name of the resource inside resoucePackagetarget
- 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.
TheClassLoader
used to obtain the resource is up to the implementation.- Parameters:
resourcePackage
- The package of the resourceresourceName
- The name of the resource inside resoucePackagetarget
- The target location inside the container- Returns:
- This
Archive
- Throws:
IllegalArgumentException
- If the package, resource name, or target is not specified
-