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 theArchive
is up to the implementations/specifications.- Version:
- $Revision: $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
addAsResource(java.io.File resource)
Adds theFile
as a resource to the container, returning the container itself.T
addAsResource(java.io.File resource, java.lang.String target)
Adds theFile
as a resource to the container, returning the container itself.T
addAsResource(java.io.File resource, ArchivePath target)
Adds theFile
as a resource to the container, returning the container itself.T
addAsResource(java.lang.Package resourcePackage, java.lang.String resourceName)
Adds the resource as a resource to the container, returning the container itself.T
addAsResource(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.T
addAsResource(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.T
addAsResource(java.lang.String resourceName)
Adds the resource as a resource to the container, returning the container itself.T
addAsResource(java.lang.String resourceName, java.lang.String target)
Adds the resource as a resource to the container, returning the container itself.T
addAsResource(java.lang.String resourceName, ArchivePath target)
Adds the resource with the specified name to the container, returning the container itself.T
addAsResource(java.lang.String resourceName, ArchivePath target, java.lang.ClassLoader classLoader)
Adds the resource as a resource to the container, returning the container itself.T
addAsResource(java.net.URL resource, java.lang.String target)
Adds theURL
as a resource to the container, returning the container itself.T
addAsResource(java.net.URL resource, ArchivePath target)
Adds theURL
as a resource to the container, returning the container itself.T
addAsResource(Asset resource, java.lang.String target)
Adds theAsset
as a resource to the container, returning the container itself.T
addAsResource(Asset resource, ArchivePath target)
Adds theAsset
as a resource to the container, returning the container itself.T
addAsResources(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.
TheClassLoader
used 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 theFile
as a resource to the container, returning the container itself.
TheFile
will be placed into the Container Library path underFile.getName()
.- Parameters:
resource
-File
resource 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.
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 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 theFile
as a 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 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 theURL
as a 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 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 theAsset
as a 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 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.
TheClassLoader
used 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 theClassLoader
resource 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.
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 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 theFile
as a 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 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 theURL
as a 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 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 theAsset
as a 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 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.
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:
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.
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:
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.
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:
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.
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:
java.lang.IllegalArgumentException
- if resourcePackage is nulljava.lang.IllegalArgumentException
- if resourceName is nulljava.lang.IllegalArgumentException
- if target is null
-
-