Interface LibraryContainer<T extends Archive<T>>
-
- All Known Subinterfaces:
EnterpriseArchive,ResourceAdapterArchive,WebArchive
- All Known Implementing Classes:
ContainerBase,EnterpriseArchiveImpl,EnterpriseContainerBase,GenericArchiveImpl,JavaArchiveImpl,ResourceAdapterArchiveImpl,ResourceAdapterContainerBase,WebArchiveImpl,WebContainerBase
public interface LibraryContainer<T extends Archive<T>>Defines the contract for a component capable of storing Libraries.
The actual path to the Library resources within theArchiveis up to the implementations/specifications.- Version:
- $Revision: $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TaddAsLibraries(java.io.File... resources)Add multipleFileto thisArchiveas libraries to the container, returning the container itself.TaddAsLibraries(java.lang.String... resourceNames)Add multiple resources to thisArchiveas libraries to the container, returning the container itself.TaddAsLibraries(java.util.Collection<? extends Archive<?>> archives)TaddAsLibraries(Archive<?>... archives)TaddAsLibraries(Archive<?>[]... archives)TaddAsLibrary(java.io.File resource)Adds theFileas a library to the container, returning the container itself.TaddAsLibrary(java.io.File resource, java.lang.String target)Adds theFileas a library to the container, returning the container itself.TaddAsLibrary(java.io.File resource, ArchivePath target)Adds theFileas a library to the container, returning the container itself.TaddAsLibrary(java.lang.String resourceName)Adds the resource as a library to the container, returning the container itself.TaddAsLibrary(java.lang.String resourceName, java.lang.String target)Adds the resource as a library to the container, returning the container itself.TaddAsLibrary(java.lang.String resourceName, ArchivePath target)Adds the resource as a library to the container, returning the container itself.TaddAsLibrary(java.net.URL resource, java.lang.String target)Adds theURLas a library to the container, returning the container itself.TaddAsLibrary(java.net.URL resource, ArchivePath target)Adds theURLas a library to the container, returning the container itself.TaddAsLibrary(Archive<?> archive)TaddAsLibrary(Asset resource, java.lang.String target)Adds theAssetas a library to the container, returning the container itself.TaddAsLibrary(Asset resource, ArchivePath target)Adds theAssetas a library to the container, returning the container itself.
-
-
-
Method Detail
-
addAsLibrary
T addAsLibrary(java.lang.String resourceName) throws java.lang.IllegalArgumentException
Adds the resource as a library to the container, returning the container itself.
The resource will be placed into the Container Library 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 resourceName is null- See Also:
addAsLibrary(Asset, ArchivePath)
-
addAsLibrary
T addAsLibrary(java.io.File resource) throws java.lang.IllegalArgumentException
Adds theFileas a library 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 resourceName is null- See Also:
addAsLibrary(Asset, ArchivePath)
-
addAsLibrary
T addAsLibrary(java.lang.String resourceName, java.lang.String target) throws java.lang.IllegalArgumentException
Adds the resource as a library 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 library path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resourceName is nulljava.lang.IllegalArgumentException- if target is null- See Also:
addAsLibrary(Asset, ArchivePath)
-
addAsLibrary
T addAsLibrary(java.io.File resource, java.lang.String target) throws java.lang.IllegalArgumentException
Adds theFileas a library 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 library path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resource is nulljava.lang.IllegalArgumentException- if target is null- See Also:
addAsLibrary(Asset, ArchivePath)
-
addAsLibrary
T addAsLibrary(java.net.URL resource, java.lang.String target) throws java.lang.IllegalArgumentException
Adds theURLas a library 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 library path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resource is nulljava.lang.IllegalArgumentException- if target is null- See Also:
addAsLibrary(Asset, ArchivePath)
-
addAsLibrary
T addAsLibrary(Asset resource, java.lang.String target) throws java.lang.IllegalArgumentException
Adds theAssetas a library 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 library path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resource is nulljava.lang.IllegalArgumentException- if target is null- See Also:
addAsLibrary(Asset, ArchivePath)
-
addAsLibrary
T addAsLibrary(java.lang.String resourceName, ArchivePath target) throws java.lang.IllegalArgumentException
Adds the resource as a library 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 library path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resourceName is nulljava.lang.IllegalArgumentException- if target is null- See Also:
addAsLibrary(Asset, ArchivePath)
-
addAsLibrary
T addAsLibrary(java.io.File resource, ArchivePath target) throws java.lang.IllegalArgumentException
Adds theFileas a library 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 library path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resource is nulljava.lang.IllegalArgumentException- if target is null- See Also:
addAsLibrary(Asset, ArchivePath)
-
addAsLibrary
T addAsLibrary(java.net.URL resource, ArchivePath target) throws java.lang.IllegalArgumentException
Adds theURLas a library 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 library path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resource is nulljava.lang.IllegalArgumentException- if target is null- See Also:
addAsLibrary(Asset, ArchivePath)
-
addAsLibrary
T addAsLibrary(Asset resource, ArchivePath target) throws java.lang.IllegalArgumentException
Adds theAssetas a library to the container, returning the container itself.- Parameters:
target- The target path within the archive in which to add the resource, relative to theArchives library path.resource-Assetresource to add- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resource is nulljava.lang.IllegalArgumentException- if target is null
-
addAsLibrary
T addAsLibrary(Archive<?> archive) throws java.lang.IllegalArgumentException
Add anotherArchiveto thisArchiveas a library to the container, returning the container itself.
TheArchivewill be placed into the Container Library path underArchive.getName().- Parameters:
archive-Archiveresource to add- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- ifArchiveis null- See Also:
addAsLibrary(Asset, ArchivePath)
-
addAsLibraries
T addAsLibraries(java.lang.String... resourceNames) throws java.lang.IllegalArgumentException
Add multiple resources to thisArchiveas libraries to the container, returning the container itself.
The resources will be placed into the Container Library path under the same context from which they were retrieved.
TheClassLoaderused to obtain the resource is up to the implementation.- Parameters:
resourceNames- resources to add- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- if resourceNames are null or empty- See Also:
addAsLibrary(String)
-
addAsLibraries
T addAsLibraries(java.io.File... resources) throws java.lang.IllegalArgumentException
Add multipleFileto thisArchiveas libraries to the container, returning the container itself.
TheFiles will be placed into the Container Library path underFile.getName().- Parameters:
resources-Fileresources to add- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- ifFileresources are null or empty- See Also:
addAsLibrary(File)
-
addAsLibraries
T addAsLibraries(Archive<?>... archives) throws java.lang.IllegalArgumentException
Add multipleArchives to thisArchiveas libraries to the container, returning the container itself.
TheArchives will be placed into the Container Library path underArchive.getName().- Parameters:
archives-Archiveresources to add- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- ifArchiveresources are null- See Also:
addAsLibrary(Archive)
-
addAsLibraries
T addAsLibraries(java.util.Collection<? extends Archive<?>> archives) throws java.lang.IllegalArgumentException
Add multipleArchives to thisArchiveas libraries to the container, returning the container itself.
TheArchives will be placed into the Container Library path underArchive.getName().- Parameters:
archives-Archiveresources to add- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- ifCollectionof archives is null- See Also:
addAsLibrary(Archive)
-
addAsLibraries
T addAsLibraries(Archive<?>[]... archives) throws java.lang.IllegalArgumentException
Add multipleArchives to thisArchiveas libraries to the container, returning the container itself.
TheArchives will be placed into the Container Library path underArchive.getName().- Parameters:
archives-Archiveresources to add- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException- ifCollectionof archives is null- See Also:
addAsLibrary(Archive)
-
-