T
- public abstract class ContainerBase<T extends Archive<T>> extends AssignableBase<Archive<?>> implements Archive<T>, ManifestContainer<T>, ServiceProviderContainer<T>, ResourceContainer<T>, ClassContainer<T>, LibraryContainer<T>, ArchiveFormatAssociable
DEFAULT_MANIFEST_NAME
Modifier | Constructor and Description |
---|---|
protected |
ContainerBase(Class<T> actualType,
Archive<?> archive) |
Modifier and Type | Method and Description |
---|---|
T |
add(Archive<?> archive,
ArchivePath path,
Class<? extends StreamExporter> exporter)
Add an archive under a specific context and maintain the archive name as context path.
|
T |
add(Archive<?> archive,
String path,
Class<? extends StreamExporter> exporter)
Add an archive under a specific context and maintain the archive name as context path.
|
T |
add(Asset asset,
ArchivePath target)
Adds the specified asset under the specified path into the target context
|
T |
add(Asset asset,
ArchivePath path,
String name)
Adds the specified asset under the specified target (directory) using the specified name.
|
T |
add(Asset asset,
String name)
Adds the specified resource under the context denoted by the specified target
|
T |
add(Asset asset,
String target,
String name)
Adds the specified asset under the specified target (directory) using the specified name.
|
T |
add(NamedAsset namedAsset)
Adds the asset encapsulated within the specified
NamedAsset under the encapsulated name and target
(directory) |
T |
addAsDirectories(ArchivePath... paths)
Adds the specified directories.
|
T |
addAsDirectories(String... paths)
Adds the specified directories.
|
T |
addAsDirectory(ArchivePath path)
Adds the specified directory.
|
T |
addAsDirectory(String path)
Adds the specified directory.
|
T |
addAsLibraries(Archive<?>... archives)
|
T |
addAsLibraries(Archive<?>[]... archives)
|
T |
addAsLibraries(Collection<? extends Archive<?>> archives)
|
T |
addAsLibraries(File... resources)
|
T |
addAsLibraries(String... resourceNames)
Add multiple resources to this
Archive as libraries to the container, returning the container itself. |
T |
addAsLibrary(Archive<?> archive)
|
T |
addAsLibrary(Asset resource,
ArchivePath target)
Adds the
Asset as a library to the container, returning the container itself. |
T |
addAsLibrary(Asset resource,
String target)
Adds the
Asset as a library to the container, returning the container itself. |
T |
addAsLibrary(File resource)
Adds the
File as a library to the container, returning the container itself. |
T |
addAsLibrary(File resource,
ArchivePath target)
Adds the
File as a library to the container, returning the container itself. |
T |
addAsLibrary(File resource,
String target)
Adds the
File as a library to the container, returning the container itself. |
T |
addAsLibrary(String resourceName)
Adds the resource as a library to the container, returning the container itself.
|
T |
addAsLibrary(String resourceName,
ArchivePath target)
Adds the resource as a library to the container, returning the container itself.
|
T |
addAsLibrary(String resourceName,
String target)
Adds the resource as a library to the container, returning the container itself.
|
T |
addAsLibrary(URL resource,
ArchivePath target)
Adds the
URL as a library to the container, returning the container itself. |
T |
addAsLibrary(URL resource,
String target)
Adds the
URL as a library to the container, returning the container itself. |
T |
addAsManifestResource(Asset resource,
ArchivePath target)
Adds the
Asset as a Manifest resource to the container, returning the container itself. |
T |
addAsManifestResource(Asset resource,
String target)
Adds the
Asset as a Manifest resource to the container, returning the container itself. |
T |
addAsManifestResource(File resource)
Adds the
File as a Manifest resource to the container, returning the container itself. |
T |
addAsManifestResource(File resource,
ArchivePath target)
Adds the
File as a Manifest resource to the container, returning the container itself. |
T |
addAsManifestResource(File resource,
String target)
Adds the
File as a Manifest resource to the container, returning the container itself. |
T |
addAsManifestResource(Package resourcePackage,
String resourceName)
Adds the resource as a resource to the container, returning the container itself.
|
T |
addAsManifestResource(Package resourcePackage,
String resourceName,
ArchivePath target)
Adds the resource as a resource to a specific path inside the container, returning the container itself.
|
T |
addAsManifestResource(Package resourcePackage,
String resourceName,
String target)
Adds the resource as a resource to a specific path inside the container, returning the container itself.
|
T |
addAsManifestResource(String resourceName)
Adds the resource as a Manifest resource to the container, returning the container itself.
|
T |
addAsManifestResource(String resourceName,
ArchivePath target)
Adds the resource as a Manifest resource to the container, returning the container itself.
|
T |
addAsManifestResource(String resourceName,
String target)
Adds the resource as a Manifest resource to the container, returning the container itself.
|
T |
addAsManifestResource(URL resource,
ArchivePath target)
Adds the
URL as a Manifest resource to the container, returning the container itself. |
T |
addAsManifestResource(URL resource,
String target)
Adds the
URL as a Manifest resource to the container, returning the container itself. |
T |
addAsManifestResources(Package resourcePackage,
String... resourceNames)
Adds the resources inside the package as multiple resources to the container, returning the container itself.
|
T |
addAsResource(Asset resource,
ArchivePath target)
Adds the
Asset as a resource to the container, returning the container itself. |
T |
addAsResource(Asset resource,
String target)
Adds the
Asset as a resource to the container, returning the container itself. |
T |
addAsResource(File resource)
Adds the
File as a resource to the container, returning the container itself. |
T |
addAsResource(File resource,
ArchivePath target)
Adds the
File as a resource to the container, returning the container itself. |
T |
addAsResource(File resource,
String target)
Adds the
File as a resource to the container, returning the container itself. |
T |
addAsResource(Package resourcePackage,
String resourceName)
Adds the resource as a resource to the container, returning the container itself.
|
T |
addAsResource(Package resourcePackage,
String resourceName,
ArchivePath target)
Adds the resource as a resource to a specific path inside the container, returning the container itself.
|
T |
addAsResource(Package resourcePackage,
String resourceName,
String target)
Adds the resource as a resource to a specific path inside the container, returning the container itself.
|
T |
addAsResource(String resourceName)
Adds the resource as a resource to the container, returning the container itself.
|
T |
addAsResource(String resourceName,
ArchivePath target)
Adds the resource with the specified name to the container, returning the container itself.
|
T |
addAsResource(String resourceName,
ArchivePath target,
ClassLoader classLoader)
Adds the resource as a resource to the container, returning the container itself.
|
T |
addAsResource(String resourceName,
String target)
Adds the resource as a resource to the container, returning the container itself.
|
T |
addAsResource(URL resource,
ArchivePath target)
Adds the
URL as a resource to the container, returning the container itself. |
T |
addAsResource(URL resource,
String target)
Adds the
URL as a resource to the container, returning the container itself. |
T |
addAsResources(Package resourcePackage,
String... resourceNames)
Adds the resources inside the package as multiple resources to the container, returning the container itself.
|
T |
addAsServiceProvider(Class<?> serviceInterface,
Class<?>... serviceImpls)
Adds a META-INF/services/ServiceInterfaceName
Asset representing this service. |
T |
addAsServiceProvider(String serviceInterface,
String... serviceImpls)
Adds a META-INF/services/ServiceInterfaceName
Asset representing this service. |
T |
addAsServiceProviderAndClasses(Class<?> serviceInterface,
Class<?>... serviceImpls)
Adds a META-INF/services/ServiceInterfaceName
Asset and the classes related to the service to the
archive. |
T |
addClass(Class<?> clazz)
|
T |
addClass(String fullyQualifiedClassName)
Adds the
Class , and all member (inner) Class es, with the specified fully-qualified name, loaded
by the Thread Context ClassLoader , to the Archive . |
T |
addClass(String fullyQualifiedClassName,
ClassLoader cl)
Adds the
Class , and all member (inner) @link{Class}es, with the specified fully-qualified name, loaded by
the specified ClassLoader , to the Archive . |
T |
addClasses(Class<?>... classes)
|
T |
addDefaultPackage()
|
T |
addHandlers(ArchiveEventHandler... handlers)
Add an array of listeners for call back based.
|
T |
addManifest()
Adds a default generated MANIFEST.MF manifest to the current archive.
|
T |
addPackage(Package pack)
|
T |
addPackage(String pack)
|
T |
addPackages(boolean recursive,
Filter<ArchivePath> filter,
Package... packages)
|
T |
addPackages(boolean recursive,
Filter<ArchivePath> filter,
String... packageNames)
|
T |
addPackages(boolean recursive,
Package... packages)
|
T |
addPackages(boolean recursive,
String... packages)
|
boolean |
contains(ArchivePath path)
Denotes whether this archive contains a resource at the specified path
|
boolean |
contains(String path)
Denotes whether this archive contains a resource at the specified path
|
protected T |
covarientReturn() |
Node |
delete(ArchivePath path)
|
Node |
delete(String archivePath)
|
T |
deleteClass(Class<?> clazz)
|
T |
deleteClass(String fullyQualifiedClassName)
Deletes the
Class , and all member (inner) Class es, with the specified fully-qualified name, loaded by the
Thread Context ClassLoader , from the Archive . |
T |
deleteClasses(Class<?>... classes)
|
T |
deleteDefaultPackage()
|
T |
deletePackage(Package pack)
|
T |
deletePackage(String pack)
|
T |
deletePackages(boolean recursive,
Filter<ArchivePath> filter,
Package... packages)
|
T |
deletePackages(boolean recursive,
Filter<ArchivePath> filter,
String... packages)
|
T |
deletePackages(boolean recursive,
Package... packages)
|
T |
deletePackages(boolean recursive,
String... packages)
|
boolean |
equals(Object obj) |
T |
filter(Filter<ArchivePath> filter)
Obtains all assets matching given filter in this archive as a new Archive.
This is an alias for shallowCopy(Filter). |
Node |
get(ArchivePath path)
Obtains the
Node located at the specified path |
Node |
get(String path)
Obtains the
Node located at the specified path |
protected Class<T> |
getActualClass() |
ArchiveFormat |
getArchiveFormat() |
<X extends Archive<X>> |
getAsType(Class<X> type,
ArchivePath path)
Get a nested
Archive as a specific type.The found Archives must have been added as a Archive, no import is performed. |
<X extends Archive<X>> |
getAsType(Class<X> type,
ArchivePath path,
ArchiveFormat archiveCompression)
|
<X extends Archive<X>> |
getAsType(Class<X> type,
Filter<ArchivePath> filter)
Get all nested
Archive matching the filter as a specific type.The found Archives must have been added as a Archive, no import is performed. |
<X extends Archive<X>> |
getAsType(Class<X> type,
Filter<ArchivePath> filter,
ArchiveFormat archiveCompression)
Get all nested
Archive matching the filter as a specific type using the specify ArchiveFormat . |
<X extends Archive<X>> |
getAsType(Class<X> type,
String path)
Get a nested
Archive as a specific type.The found Archives must have been added as a Archive, no import is performed. |
<X extends Archive<X>> |
getAsType(Class<X> type,
String path,
ArchiveFormat archiveCompression)
Get a nested
Archive as a specific type using the specify ArchiveFormat |
protected abstract ArchivePath |
getClassesPath()
Should be implemented to set the path for Class related resources.
|
Map<ArchivePath,Node> |
getContent()
Obtains all assets in this archive, along with their respective paths.
|
Map<ArchivePath,Node> |
getContent(Filter<ArchivePath> filter)
Obtains all assets matching given filter in this archive, along with its respective Path.
|
String |
getId()
Obtains a globally-unique identifier for this
Archive |
protected abstract ArchivePath |
getLibraryPath()
Should be implemented to set the path for Library related resources.
|
protected abstract ArchivePath |
getManifestPath()
Should be implemented to set the path for Manifest related resources.
|
String |
getName()
Obtains the name of this archive (ie.
|
protected abstract ArchivePath |
getResourcePath()
Should be implemented to set the path for Resource related resources.
|
int |
hashCode() |
T |
merge(Archive<?> source)
Merge the contents from an existing archive without maintaining the archive name in the context path.
|
T |
merge(Archive<?> source,
ArchivePath path)
Merge the contents from an existing archive in a specific path without maintaining the archive name in the
context path.
|
T |
merge(Archive<?> source,
ArchivePath path,
Filter<ArchivePath> filter)
Merge the contents from an existing archive in a specific path without maintaining the archive name in the
context path.
|
T |
merge(Archive<?> source,
Filter<ArchivePath> filter)
Merge the contents from an existing archive without maintaining the archive name in the context path.
|
T |
merge(Archive<?> source,
String path)
Merge the contents from an existing archive in a specific path without maintaining the archive name in the
context path.
|
T |
merge(Archive<?> source,
String path,
Filter<ArchivePath> filter)
Merge the contents from an existing archive in a specific path without maintaining the archive name in the
context path.
|
T |
move(ArchivePath source,
ArchivePath target)
Moves the asset under the source path to the target path.
|
T |
move(String source,
String target)
Moves the asset under the source path to the target path.
|
T |
setManifest(Asset resource)
Adds the
Asset as MANIFEST.FM to the container, returning the container itself. |
T |
setManifest(File resource)
Adds the
File as MANIFEST.FM to the container, returning the container itself. |
T |
setManifest(Package resourcePackage,
String resourceName)
Adds the resource inside the package as a MANIFEST.MF to the container, returning the container itself.
|
T |
setManifest(String resourceName)
Adds the resource as MANIFEST.FM to the container, returning the container itself.
|
T |
setManifest(URL resource)
Adds the
URL as MANIFEST.FM to the container, returning the container itself. |
Archive<T> |
shallowCopy()
Creates a shallow copy of this
Archive . |
Archive<T> |
shallowCopy(Filter<ArchivePath> filter)
Creates a shallow copy of this
Archive based on given filter.Assets from this archive are made available
under the same paths. |
String |
toString()
Acts as a shorthand for
Archive.toString(Formatter) where the Formatters.SIMPLE is leveraged. |
String |
toString(boolean verbose)
If "true" is specified, acts as a shorthand for
Archive.toString(Formatter) where the
Formatters.VERBOSE is leveraged. |
String |
toString(Formatter formatter)
|
void |
writeTo(OutputStream outputStream,
Formatter formatter)
Prints the content of this
Archive to the specified OutputStream on the format defined by the
specified Formatter . |
as, getArchive
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
as
public ArchiveFormat getArchiveFormat()
getArchiveFormat
in interface ArchiveFormatAssociable
public T add(Archive<?> archive, String path, Class<? extends StreamExporter> exporter)
add
in interface Archive<T extends Archive<T>>
archive
- to addpath
- to useexporter
- Exporter type to use in fulfilling the Asset.openStream()
contract for the added (nested)
archive.Archive.add(org.jboss.shrinkwrap.api.Archive, java.lang.String, java.lang.Class)
public T add(Archive<?> archive, ArchivePath path, Class<? extends StreamExporter> exporter)
add
in interface Archive<T extends Archive<T>>
archive
- to addpath
- to useexporter
- Exporter type to use in fulfilling the Asset.openStream()
contract for the added (nested)
archive.Archive.add(org.jboss.shrinkwrap.api.Archive, org.jboss.shrinkwrap.api.ArchivePath,
java.lang.Class)
public T add(Asset asset, ArchivePath target) throws IllegalArgumentException
add
in interface Archive<T extends Archive<T>>
target
- The context under which to add the assetsIllegalArgumentException
- If no target or assets were specifiedArchive.add(org.jboss.shrinkwrap.api.asset.Asset,
org.jboss.shrinkwrap.api.ArchivePath)
public T add(Asset asset, ArchivePath path, String name)
add
in interface Archive<T extends Archive<T>>
path
- The context directory under which to add the assetname
- The name to assign the assent under the target namespaceArchive.add(org.jboss.shrinkwrap.api.asset.Asset,
org.jboss.shrinkwrap.api.ArchivePath, java.lang.String)
public T add(Asset asset, String target, String name) throws IllegalArgumentException
add
in interface Archive<T extends Archive<T>>
target
- The context directory under which to add the assetname
- The name to assign the assent under the target namespaceIllegalArgumentException
- If the target, name, or asset was not specifiedArchive.add(org.jboss.shrinkwrap.api.asset.Asset, java.lang.String,
java.lang.String)
public T add(NamedAsset namedAsset)
NamedAsset
under the encapsulated name and target
(directory)public T addAsDirectories(ArchivePath... paths) throws IllegalArgumentException
addAsDirectories
in interface Archive<T extends Archive<T>>
paths
- The paths to addIllegalArgumentException
- If no paths were specifiedArchive.addAsDirectories(org.jboss.shrinkwrap.api.ArchivePath[])
public T addAsDirectories(String... paths) throws IllegalArgumentException
addAsDirectories
in interface Archive<T extends Archive<T>>
paths
- The paths to addIllegalArgumentException
- If no paths were specifiedArchive.addAsDirectories(java.lang.String[])
public T addAsDirectory(ArchivePath path) throws IllegalArgumentException
addAsDirectory
in interface Archive<T extends Archive<T>>
path
- The path to addIllegalArgumentException
- If no path was specifiedArchive.addAsDirectory(org.jboss.shrinkwrap.api.ArchivePath)
public T addAsDirectory(String path) throws IllegalArgumentException
addAsDirectory
in interface Archive<T extends Archive<T>>
path
- The path to addIllegalArgumentException
- If no path was specifiedArchive.addAsDirectory(java.lang.String)
public T addHandlers(ArchiveEventHandler... handlers)
addHandlers
in interface Archive<T extends Archive<T>>
org.jboss.shrinkwrap.api.Archive#addHandlers(org.jboss.shrinkwrap.api.Filter,
org.jboss.shrinkwrap.api.ArchiveEventHandler)
public T merge(Archive<?> source) throws IllegalArgumentException
merge
in interface Archive<T extends Archive<T>>
source
- Archive to add contents fromIllegalArgumentException
- If the existing archive is not specifiedArchive.merge(org.jboss.shrinkwrap.api.Archive)
public T merge(Archive<?> source, Filter<ArchivePath> filter) throws IllegalArgumentException
ArchivePath
s to include form the source Archive
.merge
in interface Archive<T extends Archive<T>>
source
- Archive to add contents fromIllegalArgumentException
- If the existing archive is not specifiedArchive.merge(org.jboss.shrinkwrap.api.Archive, org.jboss.shrinkwrap.api.Filter)
public T merge(Archive<?> source, ArchivePath path) throws IllegalArgumentException
merge
in interface Archive<T extends Archive<T>>
source
- Archive to add contents frompath
- Path to add contents toIllegalArgumentException
- If the path or existing archive is not specifiedArchive.merge(org.jboss.shrinkwrap.api.Archive,
org.jboss.shrinkwrap.api.ArchivePath)
public T merge(Archive<?> source, ArchivePath path, Filter<ArchivePath> filter) throws IllegalArgumentException
ArchivePath
s to include form the source Archive
.merge
in interface Archive<T extends Archive<T>>
source
- Archive to add contents frompath
- Path to add contents tofilter
- Filter to use for including Asset
s in the merge.IllegalArgumentException
- If the path or existing archive is not specifiedArchive.merge(org.jboss.shrinkwrap.api.Archive,
org.jboss.shrinkwrap.api.ArchivePath, org.jboss.shrinkwrap.api.Filter)
public T merge(Archive<?> source, String path, Filter<ArchivePath> filter) throws IllegalArgumentException
ArchivePath
s to include form the source Archive
.merge
in interface Archive<T extends Archive<T>>
source
- Archive to add contents frompath
- Path to add contents tofilter
- Filter to use for including Asset
s in the merge.IllegalArgumentException
- If the path or existing archive is not specifiedArchive.merge(org.jboss.shrinkwrap.api.Archive, java.lang.String,
org.jboss.shrinkwrap.api.Filter)
public T merge(Archive<?> source, String path) throws IllegalArgumentException
merge
in interface Archive<T extends Archive<T>>
source
- Archive to add contents frompath
- Path to add contents toIllegalArgumentException
- If the path or existing archive is not specifiedArchive.merge(org.jboss.shrinkwrap.api.Archive, java.lang.String)
public T move(ArchivePath source, ArchivePath target) throws IllegalArgumentException, IllegalArchivePathException
move
in interface Archive<T extends Archive<T>>
source
- The context under which to remove the assetstarget
- The context under which to add the moved assetsIllegalArgumentException
- If any of the paths is not specifiedIllegalArchivePathException
- If the source path is invalid.Archive.move(org.jboss.shrinkwrap.api.ArchivePath,
org.jboss.shrinkwrap.api.ArchivePath)
public T move(String source, String target) throws IllegalArgumentException, IllegalArchivePathException
move
in interface Archive<T extends Archive<T>>
source
- The context under which to remove the assetstarget
- The context under which to add the moved assetsIllegalArgumentException
- If any of the paths is not specifiedIllegalArchivePathException
- If the source path is invalid.Archive.move(java.lang.String, java.lang.String)
public T add(Asset asset, String name)
public boolean contains(ArchivePath path)
public boolean contains(String path) throws IllegalArgumentException
contains
in interface Archive<T extends Archive<T>>
IllegalArgumentException
- If the path is not specifiedArchive.contains(java.lang.String)
public Node delete(ArchivePath path)
Node
in the Archive
at the specified ArchivePath
. If the path is a directory,
recursively removes all contents. If the path does not exist, return null.public Node delete(String archivePath)
Node
in the Archive
at the ArchivePath
indicated by the specified String
archivePath. If the path is a directory, recursively removes all contents. If the path does not exist, return
null.public Node get(ArchivePath path)
Node
located at the specified pathpublic Node get(String path) throws IllegalArgumentException
Node
located at the specified pathget
in interface Archive<T extends Archive<T>>
Node
, or null if nothing is found at the PathIllegalArgumentException
- If the path is not specifiedArchive.get(java.lang.String)
public <X extends Archive<X>> X getAsType(Class<X> type, String path)
Archive
as a specific type.public <X extends Archive<X>> X getAsType(Class<X> type, ArchivePath path)
Archive
as a specific type.getAsType
in interface Archive<T extends Archive<T>>
type
- The Type to return the Archive aspath
- The location of the ArchiveArchivePath
Archive.getAsType(java.lang.Class, org.jboss.shrinkwrap.api.ArchivePath)
public <X extends Archive<X>> Collection<X> getAsType(Class<X> type, Filter<ArchivePath> filter)
Archive
matching the filter as a specific type.getAsType
in interface Archive<T extends Archive<T>>
type
- The Type to return the Archive asfilter
- Filter to match resultCollection
of found Archives matching given filter or empty Collection
if non found.Archive.getAsType(java.lang.Class, org.jboss.shrinkwrap.api.Filter)
public <X extends Archive<X>> X getAsType(Class<X> type, String path, ArchiveFormat archiveCompression)
Archive
as a specific type using the specify ArchiveFormat
getAsType
in interface Archive<T extends Archive<T>>
type
- The Type to return the Archive aspath
- The location of the ArchivearchiveCompression
- The archive formatArchive.getAsType(java.lang.Class, java.lang.String,
org.jboss.shrinkwrap.api.ArchiveFormat)
public <X extends Archive<X>> X getAsType(Class<X> type, ArchivePath path, ArchiveFormat archiveCompression)
getAsType
in interface Archive<T extends Archive<T>>
type
- The Type to return the Archive aspath
- The location of the ArchivearchiveCompression
- The archive formatArchivePath
Archive.getAsType(java.lang.Class, org.jboss.shrinkwrap.api.ArchivePath,
org.jboss.shrinkwrap.api.ArchiveFormat)
public <X extends Archive<X>> Collection<X> getAsType(Class<X> type, Filter<ArchivePath> filter, ArchiveFormat archiveCompression)
Archive
matching the filter as a specific type using the specify ArchiveFormat
.getAsType
in interface Archive<T extends Archive<T>>
type
- The Type to return the Archive asfilter
- Filter to match resultarchiveCompression
- The archive formatCollection
of found Archives matching given filter or empty Collection
if non found.Archive.getAsType(java.lang.Class, org.jboss.shrinkwrap.api.Filter,
org.jboss.shrinkwrap.api.ArchiveFormat)
public T filter(Filter<ArchivePath> filter)
public Map<ArchivePath,Node> getContent()
getContent
in interface Archive<T extends Archive<T>>
Archive.getContent()
public Map<ArchivePath,Node> getContent(Filter<ArchivePath> filter)
getContent
in interface Archive<T extends Archive<T>>
Archive.getContent(org.jboss.shrinkwrap.api.Filter)
public String getName()
public Archive<T> shallowCopy()
Archive
. Assets from this archive are made available under the same paths.
However, removing old assets or adding new assets on this archive affects does not affect the new archive.shallowCopy
in interface Archive<T extends Archive<T>>
Archive.shallowCopy()
public Archive<T> shallowCopy(Filter<ArchivePath> filter)
Archive
based on given filter.Assets from this archive are made available
under the same paths. However, removing old assets or adding new assets on this archive affects does not affect
the new archive.shallowCopy
in interface Archive<T extends Archive<T>>
Archive.shallowCopy(Filter)
public String toString()
Archive.toString(Formatter)
where the Formatters.SIMPLE
is leveraged.public String toString(boolean verbose)
Archive.toString(Formatter)
where the
Formatters.VERBOSE
is leveraged. Otherwise the Formatters.SIMPLE
will be used (equivalent to
Archive.toString()
).public String toString(Formatter formatter) throws IllegalArgumentException
Archive
as returned from the specified Formatter
. Common options may be to
use the predefined formatters located in Formatters
toString
in interface Archive<T extends Archive<T>>
IllegalArgumentException
- If the formatter is not specifiedArchive.toString(org.jboss.shrinkwrap.api.formatter.Formatter)
public int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
protected abstract ArchivePath getManifestPath()
public final T setManifest(String resourceName)
ClassLoader
used to obtain the resource is up to the implementation.setManifest
in interface ManifestContainer<T extends Archive<T>>
resourceName
- resource to addManifestContainer.setManifest(java.lang.String)
public T setManifest(File resource) throws IllegalArgumentException
File
as MANIFEST.FM to the container, returning the container itself.setManifest
in interface ManifestContainer<T extends Archive<T>>
resource
- File
resource to addIllegalArgumentException
- if resource is nullManifestContainer.setManifest(java.io.File)
public T setManifest(URL resource) throws IllegalArgumentException
URL
as MANIFEST.FM to the container, returning the container itself.setManifest
in interface ManifestContainer<T extends Archive<T>>
resource
- URL
resource to addIllegalArgumentException
- if resource is nullManifestContainer.setManifest(java.net.URL)
public T setManifest(Asset resource) throws IllegalArgumentException
Asset
as MANIFEST.FM to the container, returning the container itself.setManifest
in interface ManifestContainer<T extends Archive<T>>
resource
- File
resource to addIllegalArgumentException
- if resource is nullManifestContainer.setManifest(org.jboss.shrinkwrap.api.asset.Asset)
public T setManifest(Package resourcePackage, String resourceName) throws IllegalArgumentException
ClassLoader
used to obtain the resource is up to the implementation.setManifest
in interface ManifestContainer<T extends Archive<T>>
resourcePackage
- The package of the resourceresourceName
- The name of the resource inside resoucePackageIllegalArgumentException
- if resourcePackage is nullManifestContainer.setManifest(java.lang.Package, java.lang.String)
public final T addAsManifestResource(String resourceName)
ClassLoader
used to obtain the resource is up to the implementation.addAsManifestResource
in interface ManifestContainer<T extends Archive<T>>
resourceName
- resource to addManifestContainer.addAsManifestResource(java.lang.String)
public T addAsManifestResource(File resource) throws IllegalArgumentException
File
as a Manifest resource to the container, returning the container itself. File
will be placed into the Container Manifest path under File.getName()
.addAsManifestResource
in interface ManifestContainer<T extends Archive<T>>
resource
- resource to addIllegalArgumentException
- if File
resource is nullManifestContainer.addAsManifestResource(java.io.File)
public T addAsManifestResource(String resourceName, String target) throws IllegalArgumentException
ClassLoader
used to obtain the resource is up to the implementation.addAsManifestResource
in interface ManifestContainer<T extends Archive<T>>
resourceName
- resource to addtarget
- The target path within the archive in which to add the resource, relative to the Archive
s
manifest path.IllegalArgumentException
- if resourceName is nullManifestContainer.addAsManifestResource(java.lang.String,
java.lang.String)
public T addAsManifestResource(File resource, String target) throws IllegalArgumentException
File
as a Manifest resource to the container, returning the container itself.addAsManifestResource
in interface ManifestContainer<T extends Archive<T>>
resource
- File
resource to addtarget
- The target path within the archive in which to add the resource, relative to the Archive
s
manifest path.IllegalArgumentException
- if resource is nullManifestContainer.addAsManifestResource(java.io.File, java.lang.String)
public T addAsManifestResource(URL resource, String target) throws IllegalArgumentException
ManifestContainer
URL
as a Manifest resource to the container, returning the container itself.addAsManifestResource
in interface ManifestContainer<T extends Archive<T>>
resource
- URL
resource to addtarget
- The target path within the archive in which to add the resource, relative to the Archive
s
manifest path.IllegalArgumentException
- if resource is nullManifestContainer.addAsManifestResource(Asset, ArchivePath)
public T addAsManifestResource(Asset resource, String target) throws IllegalArgumentException
ManifestContainer
Asset
as a Manifest resource to the container, returning the container itself.addAsManifestResource
in interface ManifestContainer<T extends Archive<T>>
resource
- Asset
resource to addtarget
- The target path within the archive in which to add the resource, relative to the Archive
s
manifest path.IllegalArgumentException
- if resource is nullManifestContainer.addAsManifestResource(Asset, ArchivePath)
public T addAsManifestResource(String resourceName, ArchivePath target) throws IllegalArgumentException
ManifestContainer
ClassLoader
used to obtain the resource is up to the implementation.addAsManifestResource
in interface ManifestContainer<T extends Archive<T>>
resourceName
- resource to addtarget
- The target path within the archive in which to add the resource, relative to the Archive
s
manifest path.IllegalArgumentException
- if resourceName is nullManifestContainer.addAsManifestResource(Asset, ArchivePath)
public T addAsManifestResource(File resource, ArchivePath target) throws IllegalArgumentException
ManifestContainer
File
as a Manifest resource to the container, returning the container itself.addAsManifestResource
in interface ManifestContainer<T extends Archive<T>>
resource
- File
resource to addtarget
- The target path within the archive in which to add the resource, relative to the Archive
s
manifest path.IllegalArgumentException
- if resource is nullManifestContainer.addAsManifestResource(Asset, ArchivePath)
public T addAsManifestResource(URL resource, ArchivePath target) throws IllegalArgumentException
ManifestContainer
URL
as a Manifest resource to the container, returning the container itself.addAsManifestResource
in interface ManifestContainer<T extends Archive<T>>
resource
- URL
resource to addtarget
- The target path within the archive in which to add the resource, relative to the Archive
s
manifest path.IllegalArgumentException
- if resource is nullManifestContainer.addAsManifestResource(Asset, ArchivePath)
public T addAsManifestResource(Asset resource, ArchivePath target) throws IllegalArgumentException
ManifestContainer
Asset
as a Manifest resource to the container, returning the container itself.addAsManifestResource
in interface ManifestContainer<T extends Archive<T>>
resource
- Asset
resource to addtarget
- The target path within the archive in which to add the resource, relative to the Archive
s
manifest path.IllegalArgumentException
- if resource is nullpublic T addAsManifestResources(Package resourcePackage, String... resourceNames) throws IllegalArgumentException
ManifestContainer
ClassLoader
used to obtain the resource is up to the implementation.addAsManifestResources
in interface ManifestContainer<T extends Archive<T>>
resourcePackage
- The package of the resourcesresourceNames
- The names of the resources inside resoucePackageIllegalArgumentException
- if resourcePackage is nullpublic T addAsManifestResource(Package resourcePackage, String resourceName) throws IllegalArgumentException
ManifestContainer
ClassLoader
used to obtain the resource is up to the implementation.addAsManifestResource
in interface ManifestContainer<T extends Archive<T>>
resourcePackage
- The package of the resourceresourceName
- The name of the resource inside resoucePackageIllegalArgumentException
- if resourcePackage is nullpublic T addAsManifestResource(Package resourcePackage, String resourceName, String target) throws IllegalArgumentException
ManifestContainer
ClassLoader
used to obtain the resource is up to the implementation.addAsManifestResource
in interface ManifestContainer<T extends Archive<T>>
resourcePackage
- The package of the resourceresourceName
- The name of the resource inside resoucePackagetarget
- The target location inside the containerIllegalArgumentException
- if resourcePackage is nullpublic T addAsManifestResource(Package resourcePackage, String resourceName, ArchivePath target) throws IllegalArgumentException
ManifestContainer
ClassLoader
used to obtain the resource is up to the implementation.addAsManifestResource
in interface ManifestContainer<T extends Archive<T>>
resourcePackage
- The package of the resourceresourceName
- The name of the resource inside resoucePackagetarget
- The target location inside the containerIllegalArgumentException
- if resourcePackage is nullpublic T addManifest() throws IllegalArgumentException
addManifest
in interface ManifestContainer<T extends Archive<T>>
IllegalArgumentException
- if serviceInterface is nullpublic T addAsServiceProvider(Class<?> serviceInterface, Class<?>... serviceImpls) throws IllegalArgumentException
ManifestContainer
Asset
representing this service.
Warning: this method does not add the specified classes to the archive.addAsServiceProvider
in interface ManifestContainer<T extends Archive<T>>
serviceInterface
- The Service Interface classserviceImpls
- The Service Interface ImplementationsIllegalArgumentException
- if serviceInterface is nullpublic T addAsServiceProvider(String serviceInterface, String... serviceImpls) throws IllegalArgumentException
ManifestContainer
Asset
representing this service.addAsServiceProvider
in interface ManifestContainer<T extends Archive<T>>
serviceInterface
- The Service Interface class nameserviceImpls
- The Service Interface Implementations class namesIllegalArgumentException
- if serviceInterface is nullManifestContainer.addAsServiceProvider(Class, Class...)
public T addAsServiceProviderAndClasses(Class<?> serviceInterface, Class<?>... serviceImpls) throws IllegalArgumentException
ServiceProviderContainer
Asset
and the classes related to the service to the
archive.addAsServiceProviderAndClasses
in interface ServiceProviderContainer<T extends Archive<T>>
serviceInterface
- The Service Interface classserviceImpls
- The Service Interface ImplementationsIllegalArgumentException
- if serviceInterface is nullprotected abstract ArchivePath getResourcePath()
public final T addAsResource(String resourceName) throws IllegalArgumentException
ResourceContainer
ClassLoader
used to obtain the resource is up to the implementation.addAsResource
in interface ResourceContainer<T extends Archive<T>>
resourceName
- resource to addIllegalArgumentException
- If the resourceName is nullResourceContainer.addAsResource(Asset, ArchivePath)
public final T addAsResource(File resource) throws IllegalArgumentException
ResourceContainer
File
as a resource to the container, returning the container itself. File
will be placed into the Container Library path under File.getName()
.addAsResource
in interface ResourceContainer<T extends Archive<T>>
resource
- File
resource to addIllegalArgumentException
- If the resource is nullResourceContainer.addAsResource(Asset, ArchivePath)
public final T addAsResource(String resourceName, String target) throws IllegalArgumentException
ResourceContainer
ClassLoader
used to obtain the resource is up to the implementation.addAsResource
in interface ResourceContainer<T extends Archive<T>>
resourceName
- resource to addtarget
- The target path within the archive in which to add the resource, relative to the Archive
s
resource path.IllegalArgumentException
- if resourceName is nullResourceContainer.addAsResource(Asset, ArchivePath)
public T addAsResource(File resource, String target) throws IllegalArgumentException
ResourceContainer
File
as a resource to the container, returning the container itself.addAsResource
in interface ResourceContainer<T extends Archive<T>>
resource
- File
resource to addtarget
- The target path within the archive in which to add the resource, relative to the Archive
s
resource path.IllegalArgumentException
- if resource is nullResourceContainer.addAsResource(Asset, ArchivePath)
public T addAsResource(URL resource, String target) throws IllegalArgumentException
ResourceContainer
URL
as a resource to the container, returning the container itself.addAsResource
in interface ResourceContainer<T extends Archive<T>>
resource
- URL
resource to addtarget
- The target path within the archive in which to add the resource, relative to the Archive
s
resource path.IllegalArgumentException
- if resource is nullResourceContainer.addAsResource(Asset, ArchivePath)
public T addAsResource(Asset resource, String target) throws IllegalArgumentException
ResourceContainer
Asset
as a resource to the container, returning the container itself.addAsResource
in interface ResourceContainer<T extends Archive<T>>
resource
- Asset
resource to addtarget
- The target path within the archive in which to add the resource, relative to the Archive
s
resource path.IllegalArgumentException
- if resource is nullResourceContainer.addAsResource(Asset, ArchivePath)
public T addAsResource(String resourceName, ArchivePath target) throws IllegalArgumentException
ResourceContainer
ClassLoader
used to obtain the resource is up to the implementation.addAsResource
in interface ResourceContainer<T extends Archive<T>>
resourceName
- Name of the ClassLoader
resource to addtarget
- The target within the archive into which we'll place the resourceIllegalArgumentException
- If the target is nullpublic T addAsResource(String resourceName, ArchivePath target, ClassLoader classLoader) throws IllegalArgumentException
ResourceContainer
ClassLoader
used to obtain the resource is up to the implementation.addAsResource
in interface ResourceContainer<T extends Archive<T>>
resourceName
- resource to addtarget
- The target path within the archive in which to add the resource, relative to the Archive
s
resource path.IllegalArgumentException
- if resourceName is nullResourceContainer.addAsResource(Asset, ArchivePath)
public T addAsResource(File resource, ArchivePath target) throws IllegalArgumentException
ResourceContainer
File
as a resource to the container, returning the container itself.addAsResource
in interface ResourceContainer<T extends Archive<T>>
resource
- File
resource to addtarget
- The target path within the archive in which to add the resource, relative to the Archive
s
resource path.IllegalArgumentException
- if resource is nullResourceContainer.addAsResource(Asset, ArchivePath)
public T addAsResource(URL resource, ArchivePath target) throws IllegalArgumentException
ResourceContainer
URL
as a resource to the container, returning the container itself.addAsResource
in interface ResourceContainer<T extends Archive<T>>
resource
- URL
resource to addtarget
- The target path within the archive in which to add the resource, relative to the Archive
s
resource path.IllegalArgumentException
- if resource is nullResourceContainer.addAsResource(Asset, ArchivePath)
public T addAsResource(Asset resource, ArchivePath target) throws IllegalArgumentException
ResourceContainer
Asset
as a resource to the container, returning the container itself.addAsResource
in interface ResourceContainer<T extends Archive<T>>
resource
- Asset
resource to addtarget
- The target path within the archive in which to add the resource, relative to the Archive
s
resource path.IllegalArgumentException
- if resource is nullpublic T addAsResources(Package resourcePackage, String... resourceNames) throws IllegalArgumentException
ResourceContainer
ClassLoader
used to obtain the resource is up to the implementation.addAsResources
in interface ResourceContainer<T extends Archive<T>>
resourcePackage
- The package of the resourcesresourceNames
- The names of the resources inside resoucePackageIllegalArgumentException
- if resourcePackage is nullpublic T addAsResource(Package resourcePackage, String resourceName) throws IllegalArgumentException
ResourceContainer
ClassLoader
used to obtain the resource is up to the implementation.addAsResource
in interface ResourceContainer<T extends Archive<T>>
resourcePackage
- The package of the resourceresourceName
- The name of the resource inside resoucePackageIllegalArgumentException
- if resourcePackage is nullpublic T addAsResource(Package resourcePackage, String resourceName, String target) throws IllegalArgumentException
ResourceContainer
ClassLoader
used to obtain the resource is up to the implementation.addAsResource
in interface ResourceContainer<T extends Archive<T>>
resourcePackage
- The package of the resourceresourceName
- The name of the resource inside resoucePackagetarget
- The target location inside the containerIllegalArgumentException
- if resourcePackage is nullpublic T addAsResource(Package resourcePackage, String resourceName, ArchivePath target) throws IllegalArgumentException
ResourceContainer
ClassLoader
used to obtain the resource is up to the implementation.addAsResource
in interface ResourceContainer<T extends Archive<T>>
resourcePackage
- The package of the resourceresourceName
- The name of the resource inside resoucePackagetarget
- The target location inside the containerIllegalArgumentException
- if resourcePackage is nullprotected abstract ArchivePath getClassesPath()
public T addClass(Class<?> clazz) throws IllegalArgumentException
ClassContainer
addClass
in interface ClassContainer<T extends Archive<T>>
IllegalArgumentException
- If no class were specifiedpublic T addClass(String fullyQualifiedClassName) throws IllegalArgumentException
Class
, and all member (inner) Class
es, with the specified fully-qualified name, loaded
by the Thread Context ClassLoader
, to the Archive
.addClass
in interface ClassContainer<T extends Archive<T>>
fullyQualifiedClassName
- The name of the Class
to addIllegalArgumentException
- If no class name was specifiedClassContainer.addClass(java.lang.String)
public T addClass(String fullyQualifiedClassName, ClassLoader cl) throws IllegalArgumentException
Class
, and all member (inner) @link{Class}es, with the specified fully-qualified name, loaded by
the specified ClassLoader
, to the Archive
.addClass
in interface ClassContainer<T extends Archive<T>>
fullyQualifiedClassName
- The name of the Class
to addcl
- The ClassLoader
used to load the ClassIllegalArgumentException
- If no class name was specifiedClassContainer.addClass(java.lang.String, java.lang.ClassLoader)
public T addClasses(Class<?>... classes) throws IllegalArgumentException
ClassContainer
addClasses
in interface ClassContainer<T extends Archive<T>>
classes
- The classes to add to the ArchiveIllegalArgumentException
- If no classes were specifiedpublic T addPackage(Package pack) throws IllegalArgumentException
ClassContainer
addPackage
in interface ClassContainer<T extends Archive<T>>
pack
- The Package
to addIllegalArgumentException
- If no package were specifiedClassContainer.addPackages(boolean, Package...)
public T addPackages(boolean recursive, Package... packages) throws IllegalArgumentException
ClassContainer
addPackages
in interface ClassContainer<T extends Archive<T>>
recursive
- Should the sub packages be addedpackages
- All the packages to addIllegalArgumentException
- If no packages were specifiedClassContainer.addPackages(boolean, Filter, Package...)
public T addPackages(boolean recursive, Filter<ArchivePath> filter, Package... packages) throws IllegalArgumentException
ClassContainer
Package
s to the Archive
. ArchivePath
returned to the filter is the ArchivePath
of the class, not the final location. addPackages
in interface ClassContainer<T extends Archive<T>>
recursive
- Should the sub packages be addedfilter
- filter out specific classespackages
- All the packages to addIllegalArgumentException
- If no packages were specifiedpublic T addPackage(String pack) throws IllegalArgumentException
ClassContainer
addPackage
in interface ClassContainer<T extends Archive<T>>
pack
- Package to add represented by a String ("my/package")IllegalArgumentException
- If no package were specifiedClassContainer.addPackages(boolean, Package...)
public T addDefaultPackage()
ClassContainer
addDefaultPackage
in interface ClassContainer<T extends Archive<T>>
public T addPackages(boolean recursive, String... packages) throws IllegalArgumentException
ClassContainer
addPackages
in interface ClassContainer<T extends Archive<T>>
recursive
- Should the sub packages be addedpackages
- All the packages to add represented by a String ("my/package")IllegalArgumentException
- If no packages were specifiedClassContainer.addPackages(boolean, Filter, Package...)
public T addPackages(boolean recursive, Filter<ArchivePath> filter, String... packageNames) throws IllegalArgumentException
ClassContainer
Package
s to the Archive
. ArchivePath
returned to the filter is the ArchivePath
of the class, not the final location. addPackages
in interface ClassContainer<T extends Archive<T>>
recursive
- Should the sub packages be addedfilter
- filter out specific classespackageNames
- All the packages to add represented by a String ("my/package")IllegalArgumentException
- If no packages were specifiedpublic T deleteClass(Class<?> clazz) throws IllegalArgumentException
ClassContainer
deleteClass
in interface ClassContainer<T extends Archive<T>>
IllegalArgumentException
- If no class was specifiedpublic T deleteClass(String fullyQualifiedClassName) throws IllegalArgumentException
ClassContainer
Class
, and all member (inner) Class
es, with the specified fully-qualified name, loaded by the
Thread Context ClassLoader
, from the Archive
.deleteClass
in interface ClassContainer<T extends Archive<T>>
fullyQualifiedClassName
- The name of the Class
to be deletedIllegalArgumentException
- If no class name was specifiedpublic T deleteClasses(Class<?>... classes) throws IllegalArgumentException
ClassContainer
deleteClasses
in interface ClassContainer<T extends Archive<T>>
classes
- The classes to be removed from the Archive
IllegalArgumentException
- If no classes were specifiedpublic T deletePackage(Package pack) throws IllegalArgumentException
ClassContainer
deletePackage
in interface ClassContainer<T extends Archive<T>>
pack
- The Package
to be deletedIllegalArgumentException
- If no package was specifiedClassContainer.deletePackages(boolean, Package...)
public T deletePackage(String pack) throws IllegalArgumentException
ClassContainer
deletePackage
in interface ClassContainer<T extends Archive<T>>
pack
- Package to be delete represented by a String ("my/package")IllegalArgumentException
- If no package was specifiedClassContainer.deletePackages(boolean, Package...)
public T deleteDefaultPackage()
ClassContainer
deleteDefaultPackage
in interface ClassContainer<T extends Archive<T>>
public T deletePackages(boolean recursive, Package... packages) throws IllegalArgumentException
ClassContainer
deletePackages
in interface ClassContainer<T extends Archive<T>>
recursive
- Should the sub packages be deleted?packages
- All the packages to be deletedIllegalArgumentException
- If no packages were specifiedClassContainer.deletePackages(boolean, Filter, Package...)
public T deletePackages(boolean recursive, String... packages) throws IllegalArgumentException
ClassContainer
deletePackages
in interface ClassContainer<T extends Archive<T>>
recursive
- Should the sub packages be deleted?packages
- All the packages to be deleted represented by a String ("my/package")IllegalArgumentException
- If no packages were specifiedClassContainer.deletePackages(boolean, Filter, Package...)
public T deletePackages(boolean recursive, Filter<ArchivePath> filter, Package... packages) throws IllegalArgumentException
ClassContainer
Package
s from the Archive
. ArchivePath
returned to the filter is the ArchivePath
of the class, not the final location. deletePackages
in interface ClassContainer<T extends Archive<T>>
recursive
- Should the sub packages be deleted?filter
- filter out specific classespackages
- All the packages to be deletedIllegalArgumentException
- If no packages were specified or if no filter was specifiedpublic T deletePackages(boolean recursive, Filter<ArchivePath> filter, String... packages) throws IllegalArgumentException
ClassContainer
Package
s from the Archive
. ArchivePath
returned to the filter is the ArchivePath
of the class, not the final location. deletePackages
in interface ClassContainer<T extends Archive<T>>
recursive
- Should the sub packages be deleted?filter
- filter out specific classespackages
- All the packages to be deleted represented by a String ("my/package")IllegalArgumentException
- If no packages were specified or if no filter was specifiedprotected abstract ArchivePath getLibraryPath()
public T addAsLibrary(Archive<?> archive) throws IllegalArgumentException
Archive
to this Archive
as a library to the container, returning the container
itself. Archive
will be placed into the Container Library path under Archive.getName()
.addAsLibrary
in interface LibraryContainer<T extends Archive<T>>
archive
- Archive
resource to addIllegalArgumentException
- if Archive
is nullLibraryContainer.addAsLibrary(org.jboss.shrinkwrap.api.Archive)
public T addAsLibrary(String resourceName) throws IllegalArgumentException
ClassLoader
used to obtain the resource is up to the implementation.addAsLibrary
in interface LibraryContainer<T extends Archive<T>>
resourceName
- resource to addIllegalArgumentException
- if resourceName is nullLibraryContainer.addAsLibrary(java.lang.String)
public T addAsLibrary(File resource) throws IllegalArgumentException
File
as a library to the container, returning the container itself. File
will be placed into the Container Library path under File.getName()
.addAsLibrary
in interface LibraryContainer<T extends Archive<T>>
resource
- File
resource to addIllegalArgumentException
- if resourceName is nullLibraryContainer.addAsLibrary(java.io.File)
public T addAsLibrary(String resourceName, String target) throws IllegalArgumentException
ClassLoader
used to obtain the resource is up to the implementation.addAsLibrary
in interface LibraryContainer<T extends Archive<T>>
resourceName
- resource to addtarget
- The target path within the archive in which to add the resource, relative to the Archive
s
library path.IllegalArgumentException
- if resourceName is nullLibraryContainer.addAsLibrary(java.lang.String, java.lang.String)
public T addAsLibrary(File resource, String target) throws IllegalArgumentException
File
as a library to the container, returning the container itself.addAsLibrary
in interface LibraryContainer<T extends Archive<T>>
resource
- File
resource to addtarget
- The target path within the archive in which to add the resource, relative to the Archive
s
library path.IllegalArgumentException
- if resource is nullLibraryContainer.addAsLibrary(java.io.File, java.lang.String)
public T addAsLibrary(URL resource, String target) throws IllegalArgumentException
LibraryContainer
URL
as a library to the container, returning the container itself.addAsLibrary
in interface LibraryContainer<T extends Archive<T>>
resource
- URL
resource to addtarget
- The target path within the archive in which to add the resource, relative to the Archive
s
library path.IllegalArgumentException
- if resource is nullLibraryContainer.addAsLibrary(Asset, ArchivePath)
public T addAsLibrary(Asset resource, String target) throws IllegalArgumentException
LibraryContainer
Asset
as a library to the container, returning the container itself.addAsLibrary
in interface LibraryContainer<T extends Archive<T>>
resource
- Asset
resource to addtarget
- The target path within the archive in which to add the resource, relative to the Archive
s
library path.IllegalArgumentException
- if resource is nullLibraryContainer.addAsLibrary(Asset, ArchivePath)
public T addAsLibrary(String resourceName, ArchivePath target) throws IllegalArgumentException
LibraryContainer
ClassLoader
used to obtain the resource is up to the implementation.addAsLibrary
in interface LibraryContainer<T extends Archive<T>>
resourceName
- resource to addtarget
- The target path within the archive in which to add the resource, relative to the Archive
s
library path.IllegalArgumentException
- if resourceName is nullLibraryContainer.addAsLibrary(Asset, ArchivePath)
public T addAsLibrary(File resource, ArchivePath target) throws IllegalArgumentException
LibraryContainer
File
as a library to the container, returning the container itself.addAsLibrary
in interface LibraryContainer<T extends Archive<T>>
resource
- File
resource to addtarget
- The target path within the archive in which to add the resource, relative to the Archive
s
library path.IllegalArgumentException
- if resource is nullLibraryContainer.addAsLibrary(Asset, ArchivePath)
public T addAsLibrary(URL resource, ArchivePath target) throws IllegalArgumentException
LibraryContainer
URL
as a library to the container, returning the container itself.addAsLibrary
in interface LibraryContainer<T extends Archive<T>>
resource
- URL
resource to addtarget
- The target path within the archive in which to add the resource, relative to the Archive
s
library path.IllegalArgumentException
- if resource is nullLibraryContainer.addAsLibrary(Asset, ArchivePath)
public T addAsLibrary(Asset resource, ArchivePath target) throws IllegalArgumentException
LibraryContainer
Asset
as a library to the container, returning the container itself.addAsLibrary
in interface LibraryContainer<T extends Archive<T>>
resource
- Asset
resource to addtarget
- The target path within the archive in which to add the resource, relative to the Archive
s
library path.IllegalArgumentException
- if resource is nullpublic T addAsLibraries(String... resourceNames) throws IllegalArgumentException
LibraryContainer
Archive
as libraries to the container, returning the container itself. ClassLoader
used to obtain the resource is up to the implementation.addAsLibraries
in interface LibraryContainer<T extends Archive<T>>
resourceNames
- resources to addIllegalArgumentException
- if resourceNames are null or emptyLibraryContainer.addAsLibrary(String)
public T addAsLibraries(File... resources) throws IllegalArgumentException
LibraryContainer
File
to this Archive
as libraries to the container, returning the container itself. File
s will be placed into the Container Library path under File.getName()
.addAsLibraries
in interface LibraryContainer<T extends Archive<T>>
resources
- File
resources to addIllegalArgumentException
- if File
resources are null or emptyLibraryContainer.addAsLibrary(File)
public T addAsLibraries(Archive<?>... archives) throws IllegalArgumentException
LibraryContainer
Archive
s to this Archive
as libraries to the container, returning the container
itself. Archive
s will be placed into the Container Library path under Archive.getName()
.addAsLibraries
in interface LibraryContainer<T extends Archive<T>>
archives
- Archive
resources to addIllegalArgumentException
- if Archive
resources are nullLibraryContainer.addAsLibrary(Archive)
public T addAsLibraries(Collection<? extends Archive<?>> archives) throws IllegalArgumentException
Archive
s to this Archive
as libraries to the container, returning the container
itself. Archive
s will be placed into the Container Library path under Archive.getName()
.addAsLibraries
in interface LibraryContainer<T extends Archive<T>>
archives
- Archive
resources to addIllegalArgumentException
- if Collection
of archives is nullLibraryContainer.addAsLibraries(java.util.Collection)
public T addAsLibraries(Archive<?>[]... archives) throws IllegalArgumentException
Archive
s to this Archive
as libraries to the container, returning the container
itself. Archive
s will be placed into the Container Library path under Archive.getName()
.addAsLibraries
in interface LibraryContainer<T extends Archive<T>>
archives
- Archive
resources to addIllegalArgumentException
- if Collection
of archives is nullLibraryContainer.addAsLibraries(java.util.Collection)
public void writeTo(OutputStream outputStream, Formatter formatter) throws IllegalArgumentException
Archive
to the specified OutputStream
on the format defined by the
specified Formatter
. The caller is responsible for opening, flushing and eventually closing the stream.protected T covarientReturn()
Copyright © 2016 JBoss by Red Hat. All rights reserved.