Interface ResourceContainer<T extends Archive<T>>
-
- All Known Subinterfaces:
ClassContainer<T>,EnterpriseArchive,JavaArchive,ResourceAdapterArchive,ServiceProviderContainer<T>,WebArchive
- All Known Implementing Classes:
ContainerBase,EnterpriseArchiveImpl,EnterpriseContainerBase,GenericArchiveImpl,JavaArchiveImpl,ResourceAdapterArchiveImpl,ResourceAdapterContainerBase,WebArchiveImpl,WebContainerBase
public interface ResourceContainer<T extends Archive<T>>Defines the contract for a component capable of storing a series ofClassLoader,File, andURL-based Assets as resources within an archive.
The actual path to the Resources within theArchiveis up to the implementations/specifications.- Version:
- $Revision: $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TaddAsResource(java.io.File resource)Adds theFileas a resource to the container, returning the container itself.TaddAsResource(java.io.File resource, java.lang.String target)Adds theFileas a resource to the container, returning the container itself.TaddAsResource(java.io.File resource, ArchivePath target)Adds theFileas a resource to the container, returning the container itself.TaddAsResource(java.lang.Package resourcePackage, java.lang.String resourceName)Adds the resource as a resource to the container, returning the container itself.TaddAsResource(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.TaddAsResource(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.TaddAsResource(java.lang.String resourceName)Adds the resource as a resource to the container, returning the container itself.TaddAsResource(java.lang.String resourceName, java.lang.String target)Adds the resource as a resource to the container, returning the container itself.TaddAsResource(java.lang.String resourceName, ArchivePath target)Adds the resource with the specified name to the container, returning the container itself.TaddAsResource(java.lang.String resourceName, ArchivePath target, java.lang.ClassLoader classLoader)Adds the resource as a resource to the container, returning the container itself.TaddAsResource(java.net.URL resource, java.lang.String target)Adds theURLas a resource to the container, returning the container itself.TaddAsResource(java.net.URL resource, ArchivePath target)Adds theURLas a resource to the container, returning the container itself.TaddAsResource(Asset resource, java.lang.String target)Adds theAssetas a resource to the container, returning the container itself.TaddAsResource(Asset resource, ArchivePath target)Adds theAssetas a resource to the container, returning the container itself.TaddAsResources(java.lang.Package resourcePackage, java.lang.String... resourceNames)Adds the resources inside the package as multiple resources to the container, returning the container itself.
-
-
-
Method Detail
-
addAsResource
T addAsResource(java.lang.String resourceName) throws java.lang.IllegalArgumentException
Adds the resource as a resource to the container, returning the container itself.
The resource will be placed into the Container Resource path under the same context from which it was retrieved.
TheClassLoaderused to obtain the resource is up to the implementation.- Parameters:
resourceName- resource to add- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- If the resourceName is null- See Also:
addAsResource(Asset, ArchivePath)
-
addAsResource
T addAsResource(java.io.File resource) throws java.lang.IllegalArgumentException
Adds theFileas a resource to the container, returning the container itself.
TheFilewill be placed into the Container Library path underFile.getName().- Parameters:
resource-Fileresource to add- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- If the resource is null- See Also:
addAsResource(Asset, ArchivePath)
-
addAsResource
T addAsResource(java.lang.String resourceName, java.lang.String target) throws java.lang.IllegalArgumentException
Adds the resource as a resource to the container, returning the container itself.
TheClassLoaderused 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 theArchives resource path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resourceName is nulljava.lang.IllegalArgumentException- if target is null- See Also:
addAsResource(Asset, ArchivePath)
-
addAsResource
T addAsResource(java.io.File resource, java.lang.String target) throws java.lang.IllegalArgumentException
Adds theFileas a resource to the container, returning the container itself.- Parameters:
resource-Fileresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives resource path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resource is nulljava.lang.IllegalArgumentException- if target is null- See Also:
addAsResource(Asset, ArchivePath)
-
addAsResource
T addAsResource(java.net.URL resource, java.lang.String target) throws java.lang.IllegalArgumentException
Adds theURLas a resource to the container, returning the container itself.- Parameters:
resource-URLresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives resource path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resource is nulljava.lang.IllegalArgumentException- if target is null- See Also:
addAsResource(Asset, ArchivePath)
-
addAsResource
T addAsResource(Asset resource, java.lang.String target) throws java.lang.IllegalArgumentException
Adds theAssetas a resource to the container, returning the container itself.- Parameters:
resource-Assetresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives resource path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resource is nulljava.lang.IllegalArgumentException- if target is null- See Also:
addAsResource(Asset, ArchivePath)
-
addAsResource
T addAsResource(java.lang.String resourceName, ArchivePath target) throws java.lang.IllegalArgumentException
Adds the resource with the specified name to the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Parameters:
target- The target within the archive into which we'll place the resourceresourceName- Name of theClassLoaderresource to add- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- If the target is nulljava.lang.IllegalArgumentException- If the resourceName is null
-
addAsResource
T addAsResource(java.lang.String resourceName, ArchivePath target, java.lang.ClassLoader classLoader) throws java.lang.IllegalArgumentException
Adds the resource as a resource to the container, returning the container itself.
TheClassLoaderused 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 theArchives resource path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resourceName is nulljava.lang.IllegalArgumentException- if target is null- See Also:
addAsResource(Asset, ArchivePath)
-
addAsResource
T addAsResource(java.io.File resource, ArchivePath target) throws java.lang.IllegalArgumentException
Adds theFileas a resource to the container, returning the container itself.- Parameters:
resource-Fileresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives resource path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resource is nulljava.lang.IllegalArgumentException- if target is null- See Also:
addAsResource(Asset, ArchivePath)
-
addAsResource
T addAsResource(java.net.URL resource, ArchivePath target) throws java.lang.IllegalArgumentException
Adds theURLas a resource to the container, returning the container itself.- Parameters:
resource-URLresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives resource path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resource is nulljava.lang.IllegalArgumentException- if target is null- See Also:
addAsResource(Asset, ArchivePath)
-
addAsResource
T addAsResource(Asset resource, ArchivePath target) throws java.lang.IllegalArgumentException
Adds theAssetas a resource to the container, returning the container itself.- Parameters:
resource-Assetresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives resource path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resource is nulljava.lang.IllegalArgumentException- if target is null
-
addAsResources
T addAsResources(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.- 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 nulljava.lang.IllegalArgumentException- if no resourceNames are specified or containing null
-
addAsResource
T addAsResource(java.lang.Package resourcePackage, java.lang.String resourceName) throws java.lang.IllegalArgumentException
Adds the resource as a resource to the container, returning the container itself.
TheClassLoaderused 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:
java.lang.IllegalArgumentException- if resourcePackage is nulljava.lang.IllegalArgumentException- if resourceName is null
-
addAsResource
T addAsResource(java.lang.Package resourcePackage, java.lang.String resourceName, java.lang.String target) throws java.lang.IllegalArgumentException
Adds 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.- 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 nulljava.lang.IllegalArgumentException- if resourceName is nulljava.lang.IllegalArgumentException- if target is null
-
addAsResource
T addAsResource(java.lang.Package resourcePackage, java.lang.String resourceName, ArchivePath target) throws java.lang.IllegalArgumentException
Adds 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.- 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 nulljava.lang.IllegalArgumentException- if resourceName is nulljava.lang.IllegalArgumentException- if target is null
-
-