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
| Modifier and Type | Class and Description |
|---|---|
private static class |
ContainerBase.GetTcclAction
Obtains the
Thread Context ClassLoader |
| Modifier and Type | Field and Description |
|---|---|
private java.lang.Class<T> |
actualType
The exposed archive type.
|
private static java.lang.String |
DEFAULT_MANIFEST |
private static java.lang.String |
DEFAULT_PACKAGE_NAME |
DEFAULT_MANIFEST_NAME| Modifier | Constructor and Description |
|---|---|
protected |
ContainerBase(java.lang.Class<T> actualType,
Archive<?> archive) |
| Modifier and Type | Method and Description |
|---|---|
T |
add(Archive<?> archive,
ArchivePath path,
java.lang.Class<? extends StreamExporter> exporter)
Add an archive under a specific context and maintain the archive name as context path.
|
T |
add(Archive<?> archive,
java.lang.String path,
java.lang.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,
java.lang.String name)
Adds the specified asset under the specified target (directory) using the specified name.
|
T |
add(Asset asset,
java.lang.String name)
Adds the specified resource under the context denoted by the specified target
|
T |
add(Asset asset,
java.lang.String target,
java.lang.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(java.lang.String... paths)
Adds the specified directories.
|
T |
addAsDirectory(ArchivePath path)
Adds the specified directory.
|
T |
addAsDirectory(java.lang.String path)
Adds the specified directory.
|
T |
addAsLibraries(Archive<?>... archives)
|
T |
addAsLibraries(Archive<?>[]... archives)
|
T |
addAsLibraries(java.util.Collection<? extends Archive<?>> archives)
|
T |
addAsLibraries(java.io.File... resources)
Add multiple
File to this Archive as libraries to the container, returning the container itself. |
T |
addAsLibraries(java.lang.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,
java.lang.String target)
Adds the
Asset as a library to the container, returning the container itself. |
T |
addAsLibrary(java.io.File resource)
Adds the
File as a library to the container, returning the container itself. |
T |
addAsLibrary(java.io.File resource,
ArchivePath target)
Adds the
File as a library to the container, returning the container itself. |
T |
addAsLibrary(java.io.File resource,
java.lang.String target)
Adds the
File as a library to the container, returning the container itself. |
T |
addAsLibrary(java.lang.String resourceName)
Adds the resource as a library to the container, returning the container itself.
|
T |
addAsLibrary(java.lang.String resourceName,
ArchivePath target)
Adds the resource as a library to the container, returning the container itself.
|
T |
addAsLibrary(java.lang.String resourceName,
java.lang.String target)
Adds the resource as a library to the container, returning the container itself.
|
T |
addAsLibrary(java.net.URL resource,
ArchivePath target)
Adds the
URL as a library to the container, returning the container itself. |
T |
addAsLibrary(java.net.URL resource,
java.lang.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,
java.lang.String target)
Adds the
Asset as a Manifest resource to the container, returning the container itself. |
T |
addAsManifestResource(java.io.File resource)
Adds the
File as a Manifest resource to the container, returning the container itself. |
T |
addAsManifestResource(java.io.File resource,
ArchivePath target)
Adds the
File as a Manifest resource to the container, returning the container itself. |
T |
addAsManifestResource(java.io.File resource,
java.lang.String target)
Adds the
File as a Manifest resource to the container, returning the container itself. |
T |
addAsManifestResource(java.lang.Package resourcePackage,
java.lang.String resourceName)
Adds the resource as a resource to the container, returning the container itself.
|
T |
addAsManifestResource(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 |
addAsManifestResource(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 |
addAsManifestResource(java.lang.String resourceName)
Adds the resource as a Manifest resource to the container, returning the container itself.
|
T |
addAsManifestResource(java.lang.String resourceName,
ArchivePath target)
Adds the resource as a Manifest resource to the container, returning the container itself.
|
T |
addAsManifestResource(java.lang.String resourceName,
java.lang.String target)
Adds the resource as a Manifest resource to the container, returning the container itself.
|
T |
addAsManifestResource(java.net.URL resource,
ArchivePath target)
Adds the
URL as a Manifest resource to the container, returning the container itself. |
T |
addAsManifestResource(java.net.URL resource,
java.lang.String target)
Adds the
URL as a Manifest resource to the container, returning the container itself. |
T |
addAsManifestResources(java.lang.Package resourcePackage,
java.lang.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,
java.lang.String target)
Adds the
Asset as a resource to the container, returning the container itself. |
T |
addAsResource(java.io.File resource)
Adds the
File as a resource to the container, returning the container itself. |
T |
addAsResource(java.io.File resource,
ArchivePath target)
Adds the
File as a resource to the container, returning the container itself. |
T |
addAsResource(java.io.File resource,
java.lang.String target)
Adds the
File 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,
ArchivePath 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,
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.String resourceName)
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.lang.String resourceName,
java.lang.String target)
Adds the resource as a resource to the container, returning the container itself.
|
T |
addAsResource(java.net.URL resource,
ArchivePath target)
Adds the
URL as a resource to the container, returning the container itself. |
T |
addAsResource(java.net.URL resource,
java.lang.String target)
Adds the
URL 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.
|
T |
addAsServiceProvider(java.lang.Class<?> serviceInterface,
java.lang.Class<?>... serviceImpls)
Adds a META-INF/services/ServiceInterfaceName
Asset representing this service. |
T |
addAsServiceProvider(java.lang.String serviceInterface,
java.lang.String... serviceImpls)
Adds a META-INF/services/ServiceInterfaceName
Asset representing this service. |
T |
addAsServiceProviderAndClasses(java.lang.Class<?> serviceInterface,
java.lang.Class<?>... serviceImpls)
Adds a META-INF/services/ServiceInterfaceName
Asset and the classes related to the service to the
archive. |
T |
addClass(java.lang.Class<?> clazz)
|
T |
addClass(java.lang.String fullyQualifiedClassName)
Adds the
Class, and all member (inner) Classes, with the specified fully-qualified name, loaded
by the Thread Context ClassLoader, to the Archive. |
T |
addClass(java.lang.String fullyQualifiedClassName,
java.lang.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(java.lang.Class<?>... classes)
|
T |
addDefaultPackage()
Adds all classes in the default
Package to the Archive. |
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.
|
private T |
addNestedJarFileResource(java.io.File resource,
ArchivePath target,
ArchivePath base)
Adds the specified
File resource (a nested JAR File form) to the current archive, returning the archive
itself |
private void |
addPackage(boolean recursive,
Filter<ArchivePath> filter,
java.lang.ClassLoader classLoader,
java.lang.String packageName) |
T |
addPackage(java.lang.Package pack)
Adds all classes in the specified
Package to the Archive. |
T |
addPackage(java.lang.String pack)
Adds all classes in the specified
Package to the Archive. |
private T |
addPackages(boolean recursive,
Filter<ArchivePath> filter,
java.lang.ClassLoader cl,
java.lang.Package... packages) |
private T |
addPackages(boolean recursive,
Filter<ArchivePath> filter,
java.lang.ClassLoader classLoader,
java.lang.String... packageNames) |
T |
addPackages(boolean recursive,
Filter<ArchivePath> filter,
java.lang.Package... packages)
Adds all classes accepted by the filter in the specified
Packages to the Archive. |
T |
addPackages(boolean recursive,
Filter<ArchivePath> filter,
java.lang.String... packageNames)
Adds all classes accepted by the filter in the specified
Packages to the Archive. |
T |
addPackages(boolean recursive,
java.lang.Package... packages)
Adds all classes in the specified
Packages to the Archive. |
T |
addPackages(boolean recursive,
java.lang.String... packages)
Adds all classes in the specified
Packages to the Archive. |
boolean |
contains(ArchivePath path)
Denotes whether this archive contains a resource at the specified path
|
boolean |
contains(java.lang.String path)
Denotes whether this archive contains a resource at the specified path
|
protected T |
covarientReturn() |
Node |
delete(ArchivePath path)
|
Node |
delete(java.lang.String archivePath)
|
T |
deleteClass(java.lang.Class<?> clazz)
|
T |
deleteClass(java.lang.String fullyQualifiedClassName)
Deletes the
Class, and all member (inner) Classes, with the specified fully-qualified name, loaded by the
Thread Context ClassLoader, from the Archive. |
T |
deleteClasses(java.lang.Class<?>... classes)
|
T |
deleteDefaultPackage()
Deletes all classes in the default
Package from the Archive. |
private void |
deletePackage(boolean recursive,
Filter<ArchivePath> filter,
java.lang.String packageName,
java.lang.ClassLoader classLoader) |
T |
deletePackage(java.lang.Package pack)
Deletes all classes in the specified
Package from the Archive. |
T |
deletePackage(java.lang.String pack)
Deletes all classes in the specified
Package from the Archive. |
T |
deletePackages(boolean recursive,
Filter<ArchivePath> filter,
java.lang.Package... packages)
Deletes all classes accepted by the filter in the specified
Packages from the Archive. |
T |
deletePackages(boolean recursive,
Filter<ArchivePath> filter,
java.lang.String... packages)
Delete all classes accepted by the filter in the specified
Packages from the Archive. |
T |
deletePackages(boolean recursive,
java.lang.Package... packages)
Deletes all classes in the specified
Packages from the Archive. |
T |
deletePackages(boolean recursive,
java.lang.String... packages)
Delete all classes in the specified
Packages from the Archive. |
boolean |
equals(java.lang.Object obj) |
private java.io.File |
fileFromResource(java.lang.String resourceName)
Gets a resource from the TCCL and returns its file path.
|
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(java.lang.String path)
Obtains the
Node located at the specified path |
protected java.lang.Class<T> |
getActualClass() |
private java.lang.Iterable<java.lang.ClassLoader> |
getArchiveClassLoaders() |
ArchiveFormat |
getArchiveFormat() |
<X extends Archive<X>> |
getAsType(java.lang.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(java.lang.Class<X> type,
ArchivePath path,
ArchiveFormat archiveCompression)
|
<X extends Archive<X>> |
getAsType(java.lang.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(java.lang.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(java.lang.Class<X> type,
java.lang.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(java.lang.Class<X> type,
java.lang.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.
|
java.util.Map<ArchivePath,Node> |
getContent()
Obtains all assets in this archive, along with their respective paths.
|
java.util.Map<ArchivePath,Node> |
getContent(Filter<ArchivePath> filter)
Obtains all assets matching given filter in this archive, along with its respective Path.
|
java.lang.String |
getId()
Obtains a globally-unique identifier for this
Archive |
private java.util.Set<ArchivePath> |
getInnerClasses(ArchivePath path) |
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.
|
java.lang.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,
java.lang.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,
java.lang.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(java.lang.String source,
java.lang.String target)
Moves the asset under the source path to the target path.
|
private java.lang.String |
resourceAdjustedPath(java.io.File resource) |
T |
setManifest(Asset resource)
Adds the
Asset as MANIFEST.FM to the container, returning the container itself. |
T |
setManifest(java.io.File resource)
Adds the
File as MANIFEST.FM to the container, returning the container itself. |
T |
setManifest(java.lang.Package resourcePackage,
java.lang.String resourceName)
Adds the resource inside the package as a MANIFEST.MF to the container, returning the container itself.
|
T |
setManifest(java.lang.String resourceName)
Adds the resource as MANIFEST.FM to the container, returning the container itself.
|
T |
setManifest(java.net.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. |
java.lang.String |
toString()
Acts as a shorthand for
Archive.toString(Formatter) where the Formatters.SIMPLE is leveraged. |
java.lang.String |
toString(boolean verbose)
If "true" is specified, acts as a shorthand for
Archive.toString(Formatter) where the
Formatters.VERBOSE is leveraged. |
java.lang.String |
toString(Formatter formatter)
|
void |
writeTo(java.io.OutputStream outputStream,
Formatter formatter)
|
as, getArchiveclone, finalize, getClass, notify, notifyAll, wait, wait, waitasprivate static final java.lang.String DEFAULT_MANIFEST
private static final java.lang.String DEFAULT_PACKAGE_NAME
public ArchiveFormat getArchiveFormat()
getArchiveFormat in interface ArchiveFormatAssociablepublic T add(Archive<?> archive, java.lang.String path, java.lang.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, java.lang.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 java.lang.IllegalArgumentException
add in interface Archive<T extends Archive<T>>target - The context under which to add the assetsjava.lang.IllegalArgumentException - 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, java.lang.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, java.lang.String target, java.lang.String name) throws java.lang.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 namespacejava.lang.IllegalArgumentException - 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 java.lang.IllegalArgumentException
addAsDirectories in interface Archive<T extends Archive<T>>paths - The paths to addjava.lang.IllegalArgumentException - If no paths were specifiedArchive.addAsDirectories(org.jboss.shrinkwrap.api.ArchivePath[])public T addAsDirectories(java.lang.String... paths) throws java.lang.IllegalArgumentException
addAsDirectories in interface Archive<T extends Archive<T>>paths - The paths to addjava.lang.IllegalArgumentException - If no paths were specifiedArchive.addAsDirectories(java.lang.String[])public T addAsDirectory(ArchivePath path) throws java.lang.IllegalArgumentException
addAsDirectory in interface Archive<T extends Archive<T>>path - The path to addjava.lang.IllegalArgumentException - If no path was specifiedArchive.addAsDirectory(org.jboss.shrinkwrap.api.ArchivePath)public T addAsDirectory(java.lang.String path) throws java.lang.IllegalArgumentException
addAsDirectory in interface Archive<T extends Archive<T>>path - The path to addjava.lang.IllegalArgumentException - 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 java.lang.IllegalArgumentException
public T merge(Archive<?> source, Filter<ArchivePath> filter) throws java.lang.IllegalArgumentException
ArchivePaths to include form the source Archive.public T merge(Archive<?> source, ArchivePath path) throws java.lang.IllegalArgumentException
merge in interface Archive<T extends Archive<T>>source - Archive to add contents frompath - Path to add contents tojava.lang.IllegalArgumentException - 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 java.lang.IllegalArgumentException
ArchivePaths 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 Assets in the merge.java.lang.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, java.lang.String path, Filter<ArchivePath> filter) throws java.lang.IllegalArgumentException
ArchivePaths 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 Assets in the merge.java.lang.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, java.lang.String path) throws java.lang.IllegalArgumentException
merge in interface Archive<T extends Archive<T>>source - Archive to add contents frompath - Path to add contents tojava.lang.IllegalArgumentException - 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 java.lang.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 assetsjava.lang.IllegalArgumentException - 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(java.lang.String source, java.lang.String target) throws java.lang.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 assetsjava.lang.IllegalArgumentException - 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, java.lang.String name)
public boolean contains(ArchivePath path)
public boolean contains(java.lang.String path)
throws java.lang.IllegalArgumentException
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(java.lang.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(java.lang.String path) throws java.lang.IllegalArgumentException
Node located at the specified pathpublic <X extends Archive<X>> X getAsType(java.lang.Class<X> type, java.lang.String path)
Archive as a specific type.public <X extends Archive<X>> X getAsType(java.lang.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 ArchiveArchivePathArchive.getAsType(java.lang.Class, org.jboss.shrinkwrap.api.ArchivePath)public <X extends Archive<X>> java.util.Collection<X> getAsType(java.lang.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(java.lang.Class<X> type, java.lang.String path, ArchiveFormat archiveCompression)
Archive as a specific type using the specify ArchiveFormatgetAsType 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(java.lang.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 formatArchivePathArchive.getAsType(java.lang.Class, org.jboss.shrinkwrap.api.ArchivePath,
org.jboss.shrinkwrap.api.ArchiveFormat)public <X extends Archive<X>> java.util.Collection<X> getAsType(java.lang.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 java.util.Map<ArchivePath,Node> getContent()
getContent in interface Archive<T extends Archive<T>>Archive.getContent()public java.util.Map<ArchivePath,Node> getContent(Filter<ArchivePath> filter)
getContent in interface Archive<T extends Archive<T>>Archive.getContent(org.jboss.shrinkwrap.api.Filter)public java.lang.String getName()
public java.lang.String getId()
Archivepublic 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 java.lang.String toString()
Archive.toString(Formatter) where the Formatters.SIMPLE is leveraged.public java.lang.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 java.lang.String toString(Formatter formatter) throws java.lang.IllegalArgumentException
Archive as returned from the specified Formatter. Common options may be to
use the predefined formatters located in Formatterspublic int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()public boolean equals(java.lang.Object obj)
equals in class java.lang.ObjectObject.equals(java.lang.Object)protected abstract ArchivePath getManifestPath()
public final T setManifest(java.lang.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(java.io.File resource) throws java.lang.IllegalArgumentException
File as MANIFEST.FM to the container, returning the container itself.setManifest in interface ManifestContainer<T extends Archive<T>>resource - File resource to addjava.lang.IllegalArgumentException - if resource is nullManifestContainer.setManifest(java.io.File)public T setManifest(java.net.URL resource) throws java.lang.IllegalArgumentException
URL as MANIFEST.FM to the container, returning the container itself.setManifest in interface ManifestContainer<T extends Archive<T>>resource - URL resource to addjava.lang.IllegalArgumentException - if resource is nullManifestContainer.setManifest(java.net.URL)public T setManifest(Asset resource) throws java.lang.IllegalArgumentException
Asset as MANIFEST.FM to the container, returning the container itself.setManifest in interface ManifestContainer<T extends Archive<T>>resource - File resource to addjava.lang.IllegalArgumentException - if resource is nullManifestContainer.setManifest(org.jboss.shrinkwrap.api.asset.Asset)public T setManifest(java.lang.Package resourcePackage, java.lang.String resourceName) throws java.lang.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 resoucePackagejava.lang.IllegalArgumentException - if resourcePackage is nullManifestContainer.setManifest(java.lang.Package, java.lang.String)public final T addAsManifestResource(java.lang.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(java.io.File resource) throws java.lang.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 addjava.lang.IllegalArgumentException - if File resource is nullManifestContainer.addAsManifestResource(java.io.File)public T addAsManifestResource(java.lang.String resourceName, java.lang.String target) throws java.lang.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 Archives
manifest path.java.lang.IllegalArgumentException - if resourceName is nullManifestContainer.addAsManifestResource(java.lang.String,
java.lang.String)public T addAsManifestResource(java.io.File resource, java.lang.String target) throws java.lang.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 Archives
manifest path.java.lang.IllegalArgumentException - if resource is nullManifestContainer.addAsManifestResource(java.io.File, java.lang.String)public T addAsManifestResource(java.net.URL resource, java.lang.String target) throws java.lang.IllegalArgumentException
ManifestContainerURL 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 Archives
manifest path.java.lang.IllegalArgumentException - if resource is nullManifestContainer.addAsManifestResource(Asset, ArchivePath)public T addAsManifestResource(Asset resource, java.lang.String target) throws java.lang.IllegalArgumentException
ManifestContainerAsset 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 Archives
manifest path.java.lang.IllegalArgumentException - if resource is nullManifestContainer.addAsManifestResource(Asset, ArchivePath)public T addAsManifestResource(java.lang.String resourceName, ArchivePath target) throws java.lang.IllegalArgumentException
ManifestContainerClassLoader 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 Archives
manifest path.java.lang.IllegalArgumentException - if resourceName is nullManifestContainer.addAsManifestResource(Asset, ArchivePath)private T addNestedJarFileResource(java.io.File resource, ArchivePath target, ArchivePath base) throws java.lang.IllegalArgumentException
File resource (a nested JAR File form) to the current archive, returning the archive
itselfresource - target - java.lang.IllegalArgumentExceptionprivate java.lang.String resourceAdjustedPath(java.io.File resource)
public T addAsManifestResource(java.io.File resource, ArchivePath target) throws java.lang.IllegalArgumentException
ManifestContainerFile 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 Archives
manifest path.java.lang.IllegalArgumentException - if resource is nullManifestContainer.addAsManifestResource(Asset, ArchivePath)public T addAsManifestResource(java.net.URL resource, ArchivePath target) throws java.lang.IllegalArgumentException
ManifestContainerURL 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 Archives
manifest path.java.lang.IllegalArgumentException - if resource is nullManifestContainer.addAsManifestResource(Asset, ArchivePath)public T addAsManifestResource(Asset resource, ArchivePath target) throws java.lang.IllegalArgumentException
ManifestContainerAsset 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 Archives
manifest path.java.lang.IllegalArgumentException - if resource is nullpublic T addAsManifestResources(java.lang.Package resourcePackage, java.lang.String... resourceNames) throws java.lang.IllegalArgumentException
ManifestContainerClassLoader 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 resoucePackagejava.lang.IllegalArgumentException - if resourcePackage is nullpublic T addAsManifestResource(java.lang.Package resourcePackage, java.lang.String resourceName) throws java.lang.IllegalArgumentException
ManifestContainerClassLoader 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 resoucePackagejava.lang.IllegalArgumentException - if resourcePackage is nullpublic T addAsManifestResource(java.lang.Package resourcePackage, java.lang.String resourceName, java.lang.String target) throws java.lang.IllegalArgumentException
ManifestContainerClassLoader 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 containerjava.lang.IllegalArgumentException - if resourcePackage is nullpublic T addAsManifestResource(java.lang.Package resourcePackage, java.lang.String resourceName, ArchivePath target) throws java.lang.IllegalArgumentException
ManifestContainerClassLoader 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 containerjava.lang.IllegalArgumentException - if resourcePackage is nullpublic T addManifest() throws java.lang.IllegalArgumentException
addManifest in interface ManifestContainer<T extends Archive<T>>java.lang.IllegalArgumentException - if serviceInterface is nullpublic T addAsServiceProvider(java.lang.Class<?> serviceInterface, java.lang.Class<?>... serviceImpls) throws java.lang.IllegalArgumentException
ManifestContainerAsset 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 Implementationsjava.lang.IllegalArgumentException - if serviceInterface is nullpublic T addAsServiceProvider(java.lang.String serviceInterface, java.lang.String... serviceImpls) throws java.lang.IllegalArgumentException
ManifestContainerAsset representing this service.addAsServiceProvider in interface ManifestContainer<T extends Archive<T>>serviceInterface - The Service Interface class nameserviceImpls - The Service Interface Implementations class namesjava.lang.IllegalArgumentException - if serviceInterface is nullManifestContainer.addAsServiceProvider(Class, Class...)public T addAsServiceProviderAndClasses(java.lang.Class<?> serviceInterface, java.lang.Class<?>... serviceImpls) throws java.lang.IllegalArgumentException
ServiceProviderContainerAsset 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 Implementationsjava.lang.IllegalArgumentException - if serviceInterface is nullprotected abstract ArchivePath getResourcePath()
public final T addAsResource(java.lang.String resourceName) throws java.lang.IllegalArgumentException
ResourceContainerClassLoader used to obtain the resource is up to the implementation.addAsResource in interface ResourceContainer<T extends Archive<T>>resourceName - resource to addjava.lang.IllegalArgumentException - If the resourceName is nullResourceContainer.addAsResource(Asset, ArchivePath)public final T addAsResource(java.io.File resource) throws java.lang.IllegalArgumentException
ResourceContainerFile 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 addjava.lang.IllegalArgumentException - If the resource is nullResourceContainer.addAsResource(Asset, ArchivePath)public final T addAsResource(java.lang.String resourceName, java.lang.String target) throws java.lang.IllegalArgumentException
ResourceContainerClassLoader 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 Archives
resource path.java.lang.IllegalArgumentException - if resourceName is nullResourceContainer.addAsResource(Asset, ArchivePath)public T addAsResource(java.io.File resource, java.lang.String target) throws java.lang.IllegalArgumentException
ResourceContainerFile 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 Archives
resource path.java.lang.IllegalArgumentException - if resource is nullResourceContainer.addAsResource(Asset, ArchivePath)public T addAsResource(java.net.URL resource, java.lang.String target) throws java.lang.IllegalArgumentException
ResourceContainerURL 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 Archives
resource path.java.lang.IllegalArgumentException - if resource is nullResourceContainer.addAsResource(Asset, ArchivePath)public T addAsResource(Asset resource, java.lang.String target) throws java.lang.IllegalArgumentException
ResourceContainerAsset 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 Archives
resource path.java.lang.IllegalArgumentException - if resource is nullResourceContainer.addAsResource(Asset, ArchivePath)public T addAsResource(java.lang.String resourceName, ArchivePath target) throws java.lang.IllegalArgumentException
ResourceContainerClassLoader 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 resourcejava.lang.IllegalArgumentException - If the target is nullpublic T addAsResource(java.lang.String resourceName, ArchivePath target, java.lang.ClassLoader classLoader) throws java.lang.IllegalArgumentException
ResourceContainerClassLoader 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 Archives
resource path.java.lang.IllegalArgumentException - if resourceName is nullResourceContainer.addAsResource(Asset, ArchivePath)public T addAsResource(java.io.File resource, ArchivePath target) throws java.lang.IllegalArgumentException
ResourceContainerFile 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 Archives
resource path.java.lang.IllegalArgumentException - if resource is nullResourceContainer.addAsResource(Asset, ArchivePath)public T addAsResource(java.net.URL resource, ArchivePath target) throws java.lang.IllegalArgumentException
ResourceContainerURL 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 Archives
resource path.java.lang.IllegalArgumentException - if resource is nullResourceContainer.addAsResource(Asset, ArchivePath)public T addAsResource(Asset resource, ArchivePath target) throws java.lang.IllegalArgumentException
ResourceContainerAsset 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 Archives
resource path.java.lang.IllegalArgumentException - if resource is nullpublic T addAsResources(java.lang.Package resourcePackage, java.lang.String... resourceNames) throws java.lang.IllegalArgumentException
ResourceContainerClassLoader 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 resoucePackagejava.lang.IllegalArgumentException - if resourcePackage is nullpublic T addAsResource(java.lang.Package resourcePackage, java.lang.String resourceName) throws java.lang.IllegalArgumentException
ResourceContainerClassLoader 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 resoucePackagejava.lang.IllegalArgumentException - if resourcePackage is nullpublic T addAsResource(java.lang.Package resourcePackage, java.lang.String resourceName, java.lang.String target) throws java.lang.IllegalArgumentException
ResourceContainerClassLoader 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 containerjava.lang.IllegalArgumentException - if resourcePackage is nullpublic T addAsResource(java.lang.Package resourcePackage, java.lang.String resourceName, ArchivePath target) throws java.lang.IllegalArgumentException
ResourceContainerClassLoader 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 containerjava.lang.IllegalArgumentException - if resourcePackage is nullprotected abstract ArchivePath getClassesPath()
public T addClass(java.lang.Class<?> clazz) throws java.lang.IllegalArgumentException
ClassContaineraddClass in interface ClassContainer<T extends Archive<T>>java.lang.IllegalArgumentException - If no class were specifiedpublic T addClass(java.lang.String fullyQualifiedClassName) throws java.lang.IllegalArgumentException
Class, and all member (inner) Classes, 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 addjava.lang.IllegalArgumentException - If no class name was specifiedClassContainer.addClass(java.lang.String)public T addClass(java.lang.String fullyQualifiedClassName, java.lang.ClassLoader cl) throws java.lang.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 Classjava.lang.IllegalArgumentException - If no class name was specifiedClassContainer.addClass(java.lang.String, java.lang.ClassLoader)public T addClasses(java.lang.Class<?>... classes) throws java.lang.IllegalArgumentException
ClassContaineraddClasses in interface ClassContainer<T extends Archive<T>>classes - The classes to add to the Archivejava.lang.IllegalArgumentException - If no classes were specifiedpublic T addPackage(java.lang.Package pack) throws java.lang.IllegalArgumentException
ClassContaineraddPackage in interface ClassContainer<T extends Archive<T>>pack - The Package to addjava.lang.IllegalArgumentException - If no package were specifiedClassContainer.addPackages(boolean, Package...)public T addPackages(boolean recursive, java.lang.Package... packages) throws java.lang.IllegalArgumentException
ClassContainerPackages to the Archive.addPackages in interface ClassContainer<T extends Archive<T>>recursive - Should the sub packages be addedpackages - All the packages to addjava.lang.IllegalArgumentException - If no packages were specifiedClassContainer.addPackages(boolean, Filter, Package...)public T addPackages(boolean recursive, Filter<ArchivePath> filter, java.lang.Package... packages) throws java.lang.IllegalArgumentException
ClassContainerPackages 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 addjava.lang.IllegalArgumentException - If no packages were specifiedprivate T addPackages(boolean recursive, Filter<ArchivePath> filter, java.lang.ClassLoader cl, java.lang.Package... packages) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic T addPackage(java.lang.String pack) throws java.lang.IllegalArgumentException
ClassContaineraddPackage in interface ClassContainer<T extends Archive<T>>pack - Package to add represented by a String ("my/package")java.lang.IllegalArgumentException - If no package were specifiedClassContainer.addPackages(boolean, Package...)public T addDefaultPackage()
ClassContaineraddDefaultPackage in interface ClassContainer<T extends Archive<T>>public T addPackages(boolean recursive, java.lang.String... packages) throws java.lang.IllegalArgumentException
ClassContainerPackages to the Archive.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")java.lang.IllegalArgumentException - If no packages were specifiedClassContainer.addPackages(boolean, Filter, Package...)public T addPackages(boolean recursive, Filter<ArchivePath> filter, java.lang.String... packageNames) throws java.lang.IllegalArgumentException
ClassContainerPackages 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")java.lang.IllegalArgumentException - If no packages were specifiedprivate T addPackages(boolean recursive, Filter<ArchivePath> filter, java.lang.ClassLoader classLoader, java.lang.String... packageNames)
private void addPackage(boolean recursive,
Filter<ArchivePath> filter,
java.lang.ClassLoader classLoader,
java.lang.String packageName)
public T deleteClass(java.lang.Class<?> clazz) throws java.lang.IllegalArgumentException
ClassContainerdeleteClass in interface ClassContainer<T extends Archive<T>>java.lang.IllegalArgumentException - If no class was specifiedpublic T deleteClass(java.lang.String fullyQualifiedClassName) throws java.lang.IllegalArgumentException
ClassContainerClass, and all member (inner) Classes, 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 deletedjava.lang.IllegalArgumentException - If no class name was specifiedpublic T deleteClasses(java.lang.Class<?>... classes) throws java.lang.IllegalArgumentException
ClassContainerdeleteClasses in interface ClassContainer<T extends Archive<T>>classes - The classes to be removed from the Archivejava.lang.IllegalArgumentException - If no classes were specifiedprivate java.util.Set<ArchivePath> getInnerClasses(ArchivePath path)
public T deletePackage(java.lang.Package pack) throws java.lang.IllegalArgumentException
ClassContainerdeletePackage in interface ClassContainer<T extends Archive<T>>pack - The Package to be deletedjava.lang.IllegalArgumentException - If no package was specifiedClassContainer.deletePackages(boolean, Package...)public T deletePackage(java.lang.String pack) throws java.lang.IllegalArgumentException
ClassContainerdeletePackage in interface ClassContainer<T extends Archive<T>>pack - Package to be delete represented by a String ("my/package")java.lang.IllegalArgumentException - If no package was specifiedClassContainer.deletePackages(boolean, Package...)public T deleteDefaultPackage()
ClassContainerdeleteDefaultPackage in interface ClassContainer<T extends Archive<T>>public T deletePackages(boolean recursive, java.lang.Package... packages) throws java.lang.IllegalArgumentException
ClassContainerPackages from the Archive.deletePackages in interface ClassContainer<T extends Archive<T>>recursive - Should the sub packages be deleted?packages - All the packages to be deletedjava.lang.IllegalArgumentException - If no packages were specifiedClassContainer.deletePackages(boolean, Filter, Package...)public T deletePackages(boolean recursive, java.lang.String... packages) throws java.lang.IllegalArgumentException
ClassContainerPackages from the Archive.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")java.lang.IllegalArgumentException - If no packages were specifiedClassContainer.deletePackages(boolean, Filter, Package...)public T deletePackages(boolean recursive, Filter<ArchivePath> filter, java.lang.Package... packages) throws java.lang.IllegalArgumentException
ClassContainerPackages 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 deletedjava.lang.IllegalArgumentException - If no packages were specified or if no filter was specifiedpublic T deletePackages(boolean recursive, Filter<ArchivePath> filter, java.lang.String... packages) throws java.lang.IllegalArgumentException
ClassContainerPackages 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")java.lang.IllegalArgumentException - If no packages were specified or if no filter was specifiedprivate void deletePackage(boolean recursive,
Filter<ArchivePath> filter,
java.lang.String packageName,
java.lang.ClassLoader classLoader)
protected abstract ArchivePath getLibraryPath()
public T addAsLibrary(Archive<?> archive) throws java.lang.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 addjava.lang.IllegalArgumentException - if Archive is nullLibraryContainer.addAsLibrary(org.jboss.shrinkwrap.api.Archive)public T addAsLibrary(java.lang.String resourceName) throws java.lang.IllegalArgumentException
ClassLoader used to obtain the resource is up to the implementation.addAsLibrary in interface LibraryContainer<T extends Archive<T>>resourceName - resource to addjava.lang.IllegalArgumentException - if resourceName is nullLibraryContainer.addAsLibrary(java.lang.String)public T addAsLibrary(java.io.File resource) throws java.lang.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 addjava.lang.IllegalArgumentException - if resourceName is nullLibraryContainer.addAsLibrary(java.io.File)public T addAsLibrary(java.lang.String resourceName, java.lang.String target) throws java.lang.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 Archives
library path.java.lang.IllegalArgumentException - if resourceName is nullLibraryContainer.addAsLibrary(java.lang.String, java.lang.String)public T addAsLibrary(java.io.File resource, java.lang.String target) throws java.lang.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 Archives
library path.java.lang.IllegalArgumentException - if resource is nullLibraryContainer.addAsLibrary(java.io.File, java.lang.String)public T addAsLibrary(java.net.URL resource, java.lang.String target) throws java.lang.IllegalArgumentException
LibraryContainerURL 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 Archives
library path.java.lang.IllegalArgumentException - if resource is nullLibraryContainer.addAsLibrary(Asset, ArchivePath)public T addAsLibrary(Asset resource, java.lang.String target) throws java.lang.IllegalArgumentException
LibraryContainerAsset 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 Archives
library path.java.lang.IllegalArgumentException - if resource is nullLibraryContainer.addAsLibrary(Asset, ArchivePath)public T addAsLibrary(java.lang.String resourceName, ArchivePath target) throws java.lang.IllegalArgumentException
LibraryContainerClassLoader 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 Archives
library path.java.lang.IllegalArgumentException - if resourceName is nullLibraryContainer.addAsLibrary(Asset, ArchivePath)public T addAsLibrary(java.io.File resource, ArchivePath target) throws java.lang.IllegalArgumentException
LibraryContainerFile 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 Archives
library path.java.lang.IllegalArgumentException - if resource is nullLibraryContainer.addAsLibrary(Asset, ArchivePath)public T addAsLibrary(java.net.URL resource, ArchivePath target) throws java.lang.IllegalArgumentException
LibraryContainerURL 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 Archives
library path.java.lang.IllegalArgumentException - if resource is nullLibraryContainer.addAsLibrary(Asset, ArchivePath)public T addAsLibrary(Asset resource, ArchivePath target) throws java.lang.IllegalArgumentException
LibraryContainerAsset 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 Archives
library path.java.lang.IllegalArgumentException - if resource is nullpublic T addAsLibraries(java.lang.String... resourceNames) throws java.lang.IllegalArgumentException
LibraryContainerArchive 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 addjava.lang.IllegalArgumentException - if resourceNames are null or emptyLibraryContainer.addAsLibrary(String)public T addAsLibraries(java.io.File... resources) throws java.lang.IllegalArgumentException
LibraryContainerFile to this Archive as libraries to the container, returning the container itself. Files will be placed into the Container Library path under File.getName().addAsLibraries in interface LibraryContainer<T extends Archive<T>>resources - File resources to addjava.lang.IllegalArgumentException - if File resources are null or emptyLibraryContainer.addAsLibrary(File)public T addAsLibraries(Archive<?>... archives) throws java.lang.IllegalArgumentException
LibraryContainerArchives to this Archive as libraries to the container, returning the container
itself. Archives will be placed into the Container Library path under Archive.getName().addAsLibraries in interface LibraryContainer<T extends Archive<T>>archives - Archive resources to addjava.lang.IllegalArgumentException - if Archive resources are nullLibraryContainer.addAsLibrary(Archive)public T addAsLibraries(java.util.Collection<? extends Archive<?>> archives) throws java.lang.IllegalArgumentException
Archives to this Archive as libraries to the container, returning the container
itself. Archives will be placed into the Container Library path under Archive.getName().addAsLibraries in interface LibraryContainer<T extends Archive<T>>archives - Archive resources to addjava.lang.IllegalArgumentException - if Collection of archives is nullLibraryContainer.addAsLibraries(java.util.Collection)public T addAsLibraries(Archive<?>[]... archives) throws java.lang.IllegalArgumentException
Archives to this Archive as libraries to the container, returning the container
itself. Archives will be placed into the Container Library path under Archive.getName().addAsLibraries in interface LibraryContainer<T extends Archive<T>>archives - Archive resources to addjava.lang.IllegalArgumentException - if Collection of archives is nullLibraryContainer.addAsLibraries(java.util.Collection)public void writeTo(java.io.OutputStream outputStream,
Formatter formatter)
throws java.lang.IllegalArgumentException
protected T covarientReturn()
protected java.lang.Class<T> getActualClass()
private java.io.File fileFromResource(java.lang.String resourceName)
throws java.lang.IllegalArgumentException
resourceName - is the name of the resource in the classpathURL.getFile()java.lang.IllegalArgumentException - if resourceName doesn't exist in the classpath or privileges are not grantedprivate java.lang.Iterable<java.lang.ClassLoader> getArchiveClassLoaders()