Class ContainerBase<T extends Archive<T>>
java.lang.Object
org.jboss.shrinkwrap.impl.base.AssignableBase<Archive<?>>
org.jboss.shrinkwrap.impl.base.container.ContainerBase<T>
- Type Parameters:
T-
- All Implemented Interfaces:
Archive<T>,Assignable,ClassContainer<T>,LibraryContainer<T>,ManifestContainer<T>,ResourceContainer<T>,ServiceProviderContainer<T>,ArchiveFormatAssociable
- Direct Known Subclasses:
EnterpriseContainerBase,GenericArchiveImpl,JavaArchiveImpl,ResourceAdapterContainerBase,WebContainerBase
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
ContainerBase
Abstract class that helps implement the Archive, ManifestContainer, ResourceContainer, ClassContainer and
LibraryContainer.
- Version:
- $Revision: $
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionThe exposed archive type.private static final Stringprivate static final StringFields inherited from interface org.jboss.shrinkwrap.api.container.ManifestContainer
DEFAULT_MANIFEST_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(Archive<?> archive, String path, Class<? extends StreamExporter> exporter) Add an archive under a specific context and maintain the archive name as context path.add(Archive<?> archive, ArchivePath path, Class<? extends StreamExporter> exporter) Add an archive under a specific context and maintain the archive name as context path.Adds the specified resource under the context denoted by the specified targetAdds the specified asset under the specified target (directory) using the specified name.add(Asset asset, ArchivePath target) Adds the specified asset under the specified path into the target contextadd(Asset asset, ArchivePath path, String name) Adds the specified asset under the specified target (directory) using the specified name.add(NamedAsset namedAsset) Adds the asset encapsulated within the specifiedNamedAssetunder the encapsulated name and target (directory)addAsDirectories(String... paths) Adds the specified directories.addAsDirectories(ArchivePath... paths) Adds the specified directories.addAsDirectory(String path) Adds the specified directory.addAsDirectory(ArchivePath path) Adds the specified directory.addAsLibraries(File... resources) addAsLibraries(String... resourceNames) Add multiple resources to thisArchiveas libraries to the container, returning the container itself.addAsLibraries(Collection<? extends Archive<?>> archives) addAsLibraries(Archive<?>... archives) addAsLibraries(Archive<?>[]... archives) addAsLibrary(File resource) Adds theFileas a library to the container, returning the container itself.addAsLibrary(File resource, String target) Adds theFileas a library to the container, returning the container itself.addAsLibrary(File resource, ArchivePath target) Adds theFileas a library to the container, returning the container itself.addAsLibrary(String resourceName) Adds the resource as a library to the container, returning the container itself.addAsLibrary(String resourceName, String target) Adds the resource as a library to the container, returning the container itself.addAsLibrary(String resourceName, ArchivePath target) Adds the resource as a library to the container, returning the container itself.addAsLibrary(URL resource, String target) Adds theURLas a library to the container, returning the container itself.addAsLibrary(URL resource, ArchivePath target) Adds theURLas a library to the container, returning the container itself.addAsLibrary(Archive<?> archive) addAsLibrary(Asset resource, String target) Adds theAssetas a library to the container, returning the container itself.addAsLibrary(Asset resource, ArchivePath target) Adds theAssetas a library to the container, returning the container itself.addAsManifestResource(File resource) Adds theFileas a Manifest resource to the container, returning the container itself.addAsManifestResource(File resource, String target) Adds theFileas a Manifest resource to the container, returning the container itself.addAsManifestResource(File resource, ArchivePath target) Adds theFileas a Manifest resource to the container, returning the container itself.addAsManifestResource(Package resourcePackage, String resourceName) Adds the resource as a resource to the container, returning the container itself.addAsManifestResource(Package resourcePackage, String resourceName, String target) Adds the resource as a resource to a specific path inside the container, returning the container itself.addAsManifestResource(Package resourcePackage, String resourceName, ArchivePath target) Adds the resource as a resource to a specific path inside the container, returning the container itself.final TaddAsManifestResource(String resourceName) Adds the resource as a Manifest resource to the container, returning the container itself.addAsManifestResource(String resourceName, String target) Adds the resource as a Manifest resource to the container, returning the container itself.addAsManifestResource(String resourceName, ArchivePath target) Adds the resource as a Manifest resource to the container, returning the container itself.addAsManifestResource(URL resource, String target) Adds theURLas a Manifest resource to the container, returning the container itself.addAsManifestResource(URL resource, ArchivePath target) Adds theURLas a Manifest resource to the container, returning the container itself.addAsManifestResource(Asset resource, String target) Adds theAssetas a Manifest resource to the container, returning the container itself.addAsManifestResource(Asset resource, ArchivePath target) Adds theAssetas a Manifest resource to the container, returning the container itself.addAsManifestResources(Package resourcePackage, String... resourceNames) Adds the resources inside the package as multiple resources to the container, returning the container itself.final TaddAsResource(File resource) Adds theFileas a resource to the container, returning the container itself.addAsResource(File resource, String target) Adds theFileas a resource to the container, returning the container itself.addAsResource(File resource, ArchivePath target) Adds theFileas a resource to the container, returning the container itself.addAsResource(Package resourcePackage, String resourceName) Adds the resource as a resource to the container, returning the container itself.addAsResource(Package resourcePackage, String resourceName, String target) Adds the resource as a resource to a specific path inside the container, returning the container itself.addAsResource(Package resourcePackage, String resourceName, ArchivePath target) Adds the resource as a resource to a specific path inside the container, returning the container itself.final TaddAsResource(String resourceName) Adds the resource as a resource to the container, returning the container itself.final TaddAsResource(String resourceName, String target) Adds the resource as a resource to the container, returning the container itself.addAsResource(String resourceName, ArchivePath target) Adds the resource with the specified name to the container, returning the container itself.addAsResource(String resourceName, ArchivePath target, ClassLoader classLoader) Adds the resource as a resource to the container, returning the container itself.addAsResource(URL resource, String target) Adds theURLas a resource to the container, returning the container itself.addAsResource(URL resource, ArchivePath target) Adds theURLas a resource to the container, returning the container itself.addAsResource(Asset resource, String target) Adds theAssetas a resource to the container, returning the container itself.addAsResource(Asset resource, ArchivePath target) Adds theAssetas a resource to the container, returning the container itself.addAsResources(Package resourcePackage, String... resourceNames) Adds the resources inside the package as multiple resources to the container, returning the container itself.addAsServiceProvider(Class<?> serviceInterface, Class<?>... serviceImpls) Adds a META-INF/services/ServiceInterfaceNameAssetrepresenting this service.addAsServiceProvider(String serviceInterface, String... serviceImpls) Adds a META-INF/services/ServiceInterfaceNameAssetrepresenting this service.addAsServiceProviderAndClasses(Class<?> serviceInterface, Class<?>... serviceImpls) Adds a META-INF/services/ServiceInterfaceNameAssetand the classes related to the service to the archive.Adds theClass, and all member (inner)Classes, with the specified fully-qualified name, loaded by the Thread ContextClassLoader, to theArchive.addClass(String fullyQualifiedClassName, ClassLoader cl) Adds theClass, and all member (inner) @link{Class}es, with the specified fully-qualified name, loaded by the specifiedClassLoader, to theArchive.addClasses(Class<?>... classes) addHandlers(ArchiveEventHandler... handlers) Add an array of listeners for call back based.Adds a default generated MANIFEST.MF manifest to the current archive.private TaddNestedJarFileResource(File resource, ArchivePath target, ArchivePath base) Adds the specifiedFileresource (a nested JAR File form) to the current archive, returning the archive itselfprivate voidaddPackage(boolean recursive, Filter<ArchivePath> filter, ClassLoader classLoader, String packageName) addPackage(Package pack) addPackage(String pack) addPackages(boolean recursive, Package... packages) addPackages(boolean recursive, String... packages) private TaddPackages(boolean recursive, Filter<ArchivePath> filter, ClassLoader cl, Package... packages) private TaddPackages(boolean recursive, Filter<ArchivePath> filter, ClassLoader classLoader, String... packageNames) addPackages(boolean recursive, Filter<ArchivePath> filter, Package... packages) addPackages(boolean recursive, Filter<ArchivePath> filter, String... packageNames) booleanDenotes whether this archive contains a resource at the specified pathbooleancontains(ArchivePath path) Denotes whether this archive contains a resource at the specified pathprotected Tdelete(ArchivePath path) deleteClass(Class<?> clazz) deleteClass(String fullyQualifiedClassName) Deletes theClass, and all member (inner)Classes, with the specified fully-qualified name, loaded by the Thread ContextClassLoader, from theArchive.deleteClasses(Class<?>... classes) private voiddeletePackage(boolean recursive, Filter<ArchivePath> filter, String packageName, ClassLoader classLoader) deletePackage(Package pack) deletePackage(String pack) deletePackages(boolean recursive, Package... packages) deletePackages(boolean recursive, String... packages) deletePackages(boolean recursive, Filter<ArchivePath> filter, Package... packages) deletePackages(boolean recursive, Filter<ArchivePath> filter, String... packages) booleanprivate FilefileFromResource(String resourceName) Gets a resource from the TCCL and returns its file path.filter(Filter<ArchivePath> filter) Obtains all assets matching given filter in this archive as a new Archive.
This is an alias for shallowCopy(Filter).Obtains theNodelocated at the specified pathget(ArchivePath path) Obtains theNodelocated at the specified pathprivate Iterable<ClassLoader> <X extends Archive<X>>
XGet a nestedArchiveas a specific type.
The found Archives must have been added as a Archive, no import is performed.<X extends Archive<X>>
XgetAsType(Class<X> type, String path, ArchiveFormat archiveCompression) Get a nestedArchiveas a specific type using the specifyArchiveFormat<X extends Archive<X>>
XgetAsType(Class<X> type, ArchivePath path) Get a nestedArchiveas a specific type.
The found Archives must have been added as a Archive, no import is performed.<X extends Archive<X>>
XgetAsType(Class<X> type, ArchivePath path, ArchiveFormat archiveCompression) <X extends Archive<X>>
Collection<X> getAsType(Class<X> type, Filter<ArchivePath> filter) Get all nestedArchivematching the filter as a specific type.
The found Archives must have been added as a Archive, no import is performed.<X extends Archive<X>>
Collection<X> getAsType(Class<X> type, Filter<ArchivePath> filter, ArchiveFormat archiveCompression) Get all nestedArchivematching the filter as a specific type using the specifyArchiveFormat.protected abstract ArchivePathShould be implemented to set the path for Class related resources.Obtains all assets in this archive, along with their respective paths.getContent(Filter<ArchivePath> filter) Obtains all assets matching given filter in this archive, along with its respective Path.getId()Obtains a globally-unique identifier for thisArchiveprivate Set<ArchivePath> getInnerClasses(ArchivePath path) protected abstract ArchivePathShould be implemented to set the path for Library related resources.protected abstract ArchivePathShould be implemented to set the path for Manifest related resources.getName()Obtains the name of this archive (ie.protected abstract ArchivePathShould be implemented to set the path for Resource related resources.inthashCode()Merge the contents from an existing archive without maintaining the archive name in the context path.Merge the contents from an existing archive in a specific path without maintaining the archive name in the context path.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.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.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.merge(Archive<?> source, Filter<ArchivePath> filter) Merge the contents from an existing archive without maintaining the archive name in the context path.Moves the asset under the source path to the target path.move(ArchivePath source, ArchivePath target) Moves the asset under the source path to the target path.private StringresourceAdjustedPath(File resource) setManifest(File resource) Adds theFileas MANIFEST.FM to the container, returning the container itself.setManifest(Package resourcePackage, String resourceName) Adds the resource inside the package as a MANIFEST.MF to the container, returning the container itself.final TsetManifest(String resourceName) Adds the resource as MANIFEST.FM to the container, returning the container itself.setManifest(URL resource) Adds theURLas MANIFEST.FM to the container, returning the container itself.setManifest(Asset resource) Adds theAssetas MANIFEST.FM to the container, returning the container itself.Creates a shallow copy of thisArchive.shallowCopy(Filter<ArchivePath> filter) Creates a shallow copy of thisArchivebased on given filter.Assets from this archive are made available under the same paths.toString()Acts as a shorthand forArchive.toString(Formatter)where theFormatters.SIMPLEis leveraged.toString(boolean verbose) If "true" is specified, acts as a shorthand forArchive.toString(Formatter)where theFormatters.VERBOSEis leveraged.voidwriteTo(OutputStream outputStream, Formatter formatter) Prints the content of thisArchiveto the specifiedOutputStreamon the format defined by the specifiedFormatter.Methods inherited from class org.jboss.shrinkwrap.impl.base.AssignableBase
as, getArchiveMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jboss.shrinkwrap.api.Assignable
as
-
Field Details
-
DEFAULT_MANIFEST
- See Also:
-
DEFAULT_PACKAGE_NAME
- See Also:
-
actualType
The exposed archive type.
-
-
Constructor Details
-
ContainerBase
-
-
Method Details
-
getArchiveFormat
- Specified by:
getArchiveFormatin interfaceArchiveFormatAssociable
-
add
Add an archive under a specific context and maintain the archive name as context path. -
add
Add an archive under a specific context and maintain the archive name as context path. -
add
Adds the specified asset under the specified path into the target context -
add
Adds the specified asset under the specified target (directory) using the specified name. The resultant path will be treating the specified path as a prefix namespace, then appending the name. -
add
Adds the specified asset under the specified target (directory) using the specified name. The resultant path will be treating the specified path as a prefix namespace, then appending the name.- Specified by:
addin interfaceArchive<T extends Archive<T>>- Parameters:
asset-target- The context directory under which to add the assetname- The name to assign the assent under the target namespace- Returns:
- Throws:
IllegalArgumentException- If the target, name, or asset was not specified- See Also:
-
add
Adds the asset encapsulated within the specifiedNamedAssetunder the encapsulated name and target (directory) -
addAsDirectories
Adds the specified directories.- Specified by:
addAsDirectoriesin interfaceArchive<T extends Archive<T>>- Parameters:
paths- The paths to add- Returns:
- This archive
- Throws:
IllegalArgumentException- If no paths were specified- See Also:
-
addAsDirectories
Adds the specified directories.- Specified by:
addAsDirectoriesin interfaceArchive<T extends Archive<T>>- Parameters:
paths- The paths to add- Returns:
- This archive
- Throws:
IllegalArgumentException- If no paths were specified- See Also:
-
addAsDirectory
Adds the specified directory.- Specified by:
addAsDirectoryin interfaceArchive<T extends Archive<T>>- Parameters:
path- The path to add- Returns:
- This archive
- Throws:
IllegalArgumentException- If no path was specified- See Also:
-
addAsDirectory
Adds the specified directory.- Specified by:
addAsDirectoryin interfaceArchive<T extends Archive<T>>- Parameters:
path- The path to add- Returns:
- This archive
- Throws:
IllegalArgumentException- If no path was specified- See Also:
-
addHandlers
Add an array of listeners for call back based.- Specified by:
addHandlersin interfaceArchive<T extends Archive<T>>- Returns:
- This archive
- See Also:
-
merge
Merge the contents from an existing archive without maintaining the archive name in the context path. -
merge
Merge the contents from an existing archive without maintaining the archive name in the context path. The filter control whichArchivePaths to include form the sourceArchive. -
merge
Merge the contents from an existing archive in a specific path without maintaining the archive name in the context path. -
merge
public T merge(Archive<?> source, ArchivePath path, Filter<ArchivePath> filter) throws IllegalArgumentException Merge the contents from an existing archive in a specific path without maintaining the archive name in the context path. The filter control whichArchivePaths to include form the sourceArchive.- Specified by:
mergein interfaceArchive<T extends Archive<T>>- Parameters:
source- Archive to add contents frompath- Path to add contents tofilter- Filter to use for includingAssets in the merge.- Returns:
- Throws:
IllegalArgumentException- If the path or existing archive is not specified- See Also:
-
merge
public T merge(Archive<?> source, String path, Filter<ArchivePath> filter) throws IllegalArgumentException Merge the contents from an existing archive in a specific path without maintaining the archive name in the context path. The filter control whichArchivePaths to include form the sourceArchive.- Specified by:
mergein interfaceArchive<T extends Archive<T>>- Parameters:
source- Archive to add contents frompath- Path to add contents tofilter- Filter to use for includingAssets in the merge.- Returns:
- Throws:
IllegalArgumentException- If the path or existing archive is not specified- See Also:
-
merge
Merge the contents from an existing archive in a specific path without maintaining the archive name in the context path. -
move
public T move(ArchivePath source, ArchivePath target) throws IllegalArgumentException, IllegalArchivePathException Moves the asset under the source path to the target path.- Specified by:
movein interfaceArchive<T extends Archive<T>>- Parameters:
source- The context under which to remove the assetstarget- The context under which to add the moved assets- Returns:
- the resulting archive with the moved assets
- Throws:
IllegalArgumentException- If any of the paths is not specifiedIllegalArchivePathException- If the source path is invalid.- See Also:
-
move
public T move(String source, String target) throws IllegalArgumentException, IllegalArchivePathException Moves the asset under the source path to the target path.- Specified by:
movein interfaceArchive<T extends Archive<T>>- Parameters:
source- The context under which to remove the assetstarget- The context under which to add the moved assets- Returns:
- the resulting archive with the moved assets
- Throws:
IllegalArgumentException- If any of the paths is not specifiedIllegalArchivePathException- If the source path is invalid.- See Also:
-
add
Adds the specified resource under the context denoted by the specified target -
contains
Denotes whether this archive contains a resource at the specified path -
contains
Denotes whether this archive contains a resource at the specified path -
delete
Removes theNodein theArchiveat the specifiedArchivePath. If the path is a directory, recursively removes all contents. If the path does not exist, return null. -
delete
Removes theNodein theArchiveat theArchivePathindicated by the specified String archivePath. If the path is a directory, recursively removes all contents. If the path does not exist, return null. -
get
Obtains theNodelocated at the specified path -
get
Obtains theNodelocated at the specified path -
getAsType
Get a nestedArchiveas a specific type.
The found Archives must have been added as a Archive, no import is performed. -
getAsType
Get a nestedArchiveas a specific type.
The found Archives must have been added as a Archive, no import is performed. -
getAsType
Get all nestedArchivematching the filter as a specific type.
The found Archives must have been added as a Archive, no import is performed.- Specified by:
getAsTypein interfaceArchive<T extends Archive<T>>- Type Parameters:
X-- Parameters:
type- The Type to return the Archive asfilter- Filter to match result- Returns:
- A
Collectionof found Archives matching given filter or emptyCollectionif non found. - See Also:
-
getAsType
public <X extends Archive<X>> X getAsType(Class<X> type, String path, ArchiveFormat archiveCompression) Get a nestedArchiveas a specific type using the specifyArchiveFormat -
getAsType
public <X extends Archive<X>> X getAsType(Class<X> type, ArchivePath path, ArchiveFormat archiveCompression) -
getAsType
public <X extends Archive<X>> Collection<X> getAsType(Class<X> type, Filter<ArchivePath> filter, ArchiveFormat archiveCompression) Get all nestedArchivematching the filter as a specific type using the specifyArchiveFormat.- Specified by:
getAsTypein interfaceArchive<T extends Archive<T>>- Type Parameters:
X-- Parameters:
type- The Type to return the Archive asfilter- Filter to match resultarchiveCompression- The archive format- Returns:
- A
Collectionof found Archives matching given filter or emptyCollectionif non found. - See Also:
-
filter
Obtains all assets matching given filter in this archive as a new Archive.
This is an alias for shallowCopy(Filter). -
getContent
Obtains all assets in this archive, along with their respective paths. The returned Map will be an immutable view.- Specified by:
getContentin interfaceArchive<T extends Archive<T>>- Returns:
- See Also:
-
getContent
Obtains all assets matching given filter in this archive, along with its respective Path. The returned Map will be an immutable view.- Specified by:
getContentin interfaceArchive<T extends Archive<T>>- Returns:
- See Also:
-
getName
Obtains the name of this archive (ie. myLibrary.jar) -
getId
Obtains a globally-unique identifier for thisArchive -
shallowCopy
Creates a shallow copy of thisArchive. 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.- Specified by:
shallowCopyin interfaceArchive<T extends Archive<T>>- Returns:
- a new archive with a copy of the pointers to the assets
- See Also:
-
shallowCopy
Creates a shallow copy of thisArchivebased 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.- Specified by:
shallowCopyin interfaceArchive<T extends Archive<T>>- Returns:
- a new archive with a copy of the pointers to the assets
- See Also:
-
toString
Acts as a shorthand forArchive.toString(Formatter)where theFormatters.SIMPLEis leveraged. -
toString
If "true" is specified, acts as a shorthand forArchive.toString(Formatter)where theFormatters.VERBOSEis leveraged. Otherwise theFormatters.SIMPLEwill be used (equivalent toArchive.toString()). -
toString
Returns a view of thisArchiveas returned from the specifiedFormatter. Common options may be to use the predefined formatters located inFormatters -
hashCode
public int hashCode() -
equals
-
getManifestPath
Should be implemented to set the path for Manifest related resources.- Returns:
- Base Path for the ManifestContainer resources
-
setManifest
Adds the resource as MANIFEST.FM to the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
setManifestin interfaceManifestContainer<T extends Archive<T>>- Parameters:
resourceName- resource to add- Returns:
- This virtual archive
- See Also:
-
setManifest
Adds theFileas MANIFEST.FM to the container, returning the container itself.- Specified by:
setManifestin interfaceManifestContainer<T extends Archive<T>>- Parameters:
resource-Fileresource to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resource is null- See Also:
-
setManifest
Adds theURLas MANIFEST.FM to the container, returning the container itself.- Specified by:
setManifestin interfaceManifestContainer<T extends Archive<T>>- Parameters:
resource-URLresource to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resource is null- See Also:
-
setManifest
Adds theAssetas MANIFEST.FM to the container, returning the container itself.- Specified by:
setManifestin interfaceManifestContainer<T extends Archive<T>>- Parameters:
resource-Fileresource to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resource is null- See Also:
-
setManifest
Adds the resource inside the package as a MANIFEST.MF to the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
setManifestin interfaceManifestContainer<T extends Archive<T>>- Parameters:
resourcePackage- The package of the resourceresourceName- The name of the resource inside resoucePackage- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resourcePackage is nullIllegalArgumentException- if resourceName is null- See Also:
-
addAsManifestResource
Adds the resource as a Manifest resource to the container, returning the container itself.
The resource will be placed into the Container Manifest path under the same context from which it was retrieved.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsManifestResourcein interfaceManifestContainer<T extends Archive<T>>- Parameters:
resourceName- resource to add- Returns:
- This virtual archive
- See Also:
-
addAsManifestResource
Adds theFileas a Manifest resource to the container, returning the container itself.
TheFilewill be placed into the Container Manifest path underFile.getName().- Specified by:
addAsManifestResourcein interfaceManifestContainer<T extends Archive<T>>- Parameters:
resource- resource to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- ifFileresource is nullIllegalArgumentException- if target is null- See Also:
-
addAsManifestResource
Adds the resource as a Manifest resource to the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsManifestResourcein interfaceManifestContainer<T extends Archive<T>>- Parameters:
resourceName- resource to addtarget- The target path within the archive in which to add the resource, relative to theArchives manifest path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resourceName is nullIllegalArgumentException- if target is null- See Also:
-
addAsManifestResource
Adds theFileas a Manifest resource to the container, returning the container itself.- Specified by:
addAsManifestResourcein interfaceManifestContainer<T extends Archive<T>>- Parameters:
resource-Fileresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives manifest path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resource is nullIllegalArgumentException- if target is null- See Also:
-
addAsManifestResource
Description copied from interface:ManifestContainerAdds theURLas a Manifest resource to the container, returning the container itself.- Specified by:
addAsManifestResourcein interfaceManifestContainer<T extends Archive<T>>- Parameters:
resource-URLresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives manifest path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resource is nullIllegalArgumentException- if target is null- See Also:
-
addAsManifestResource
Description copied from interface:ManifestContainerAdds theAssetas a Manifest resource to the container, returning the container itself.- Specified by:
addAsManifestResourcein interfaceManifestContainer<T extends Archive<T>>- Parameters:
resource-Assetresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives manifest path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resource is nullIllegalArgumentException- if target is null- See Also:
-
addAsManifestResource
public T addAsManifestResource(String resourceName, ArchivePath target) throws IllegalArgumentException Description copied from interface:ManifestContainerAdds the resource as a Manifest resource to the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsManifestResourcein interfaceManifestContainer<T extends Archive<T>>- Parameters:
resourceName- resource to addtarget- The target path within the archive in which to add the resource, relative to theArchives manifest path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resourceName is nullIllegalArgumentException- if target is null- See Also:
-
addNestedJarFileResource
private T addNestedJarFileResource(File resource, ArchivePath target, ArchivePath base) throws IllegalArgumentException Adds the specifiedFileresource (a nested JAR File form) to the current archive, returning the archive itself- Parameters:
resource-target-- Returns:
- Throws:
IllegalArgumentException
-
resourceAdjustedPath
-
addAsManifestResource
Description copied from interface:ManifestContainerAdds theFileas a Manifest resource to the container, returning the container itself.- Specified by:
addAsManifestResourcein interfaceManifestContainer<T extends Archive<T>>- Parameters:
resource-Fileresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives manifest path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resource is nullIllegalArgumentException- if target is null- See Also:
-
addAsManifestResource
Description copied from interface:ManifestContainerAdds theURLas a Manifest resource to the container, returning the container itself.- Specified by:
addAsManifestResourcein interfaceManifestContainer<T extends Archive<T>>- Parameters:
resource-URLresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives manifest path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resource is nullIllegalArgumentException- if target is null- See Also:
-
addAsManifestResource
Description copied from interface:ManifestContainerAdds theAssetas a Manifest resource to the container, returning the container itself.- Specified by:
addAsManifestResourcein interfaceManifestContainer<T extends Archive<T>>- Parameters:
resource-Assetresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives manifest path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resource is nullIllegalArgumentException- if target is null
-
addAsManifestResources
public T addAsManifestResources(Package resourcePackage, String... resourceNames) throws IllegalArgumentException Description copied from interface:ManifestContainerAdds the resources inside the package as multiple resources to the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsManifestResourcesin interfaceManifestContainer<T extends Archive<T>>- Parameters:
resourcePackage- The package of the resourcesresourceNames- The names of the resources inside resoucePackage- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resourcePackage is nullIllegalArgumentException- if no resourceNames are specified or containing null
-
addAsManifestResource
public T addAsManifestResource(Package resourcePackage, String resourceName) throws IllegalArgumentException Description copied from interface:ManifestContainerAdds the resource as a resource to the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsManifestResourcein interfaceManifestContainer<T extends Archive<T>>- Parameters:
resourcePackage- The package of the resourceresourceName- The name of the resource inside resoucePackage- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resourcePackage is nullIllegalArgumentException- if resourceName is null
-
addAsManifestResource
public T addAsManifestResource(Package resourcePackage, String resourceName, String target) throws IllegalArgumentException Description copied from interface:ManifestContainerAdds the resource as a resource to a specific path inside the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsManifestResourcein interfaceManifestContainer<T extends Archive<T>>- Parameters:
resourcePackage- The package of the resourceresourceName- The name of the resource inside resoucePackagetarget- The target location inside the container- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resourcePackage is nullIllegalArgumentException- if resourceName is nullIllegalArgumentException- if target is null
-
addAsManifestResource
public T addAsManifestResource(Package resourcePackage, String resourceName, ArchivePath target) throws IllegalArgumentException Description copied from interface:ManifestContainerAdds the resource as a resource to a specific path inside the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsManifestResourcein interfaceManifestContainer<T extends Archive<T>>- Parameters:
resourcePackage- The package of the resourceresourceName- The name of the resource inside resoucePackagetarget- The target location inside the container- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resourcePackage is nullIllegalArgumentException- if resourceName is nullIllegalArgumentException- if target is null
-
addManifest
Adds a default generated MANIFEST.MF manifest to the current archive.- Specified by:
addManifestin interfaceManifestContainer<T extends Archive<T>>- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if serviceInterface is null
-
addAsServiceProvider
public T addAsServiceProvider(Class<?> serviceInterface, Class<?>... serviceImpls) throws IllegalArgumentException Description copied from interface:ManifestContainerAdds a META-INF/services/ServiceInterfaceNameAssetrepresenting this service. Warning: this method does not add the specified classes to the archive.- Specified by:
addAsServiceProviderin interfaceManifestContainer<T extends Archive<T>>- Parameters:
serviceInterface- The Service Interface classserviceImpls- The Service Interface Implementations- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if serviceInterface is nullIllegalArgumentException- if serviceImpls is null or contain null values
-
addAsServiceProvider
public T addAsServiceProvider(String serviceInterface, String... serviceImpls) throws IllegalArgumentException Description copied from interface:ManifestContainerAdds a META-INF/services/ServiceInterfaceNameAssetrepresenting this service.- Specified by:
addAsServiceProviderin interfaceManifestContainer<T extends Archive<T>>- Parameters:
serviceInterface- The Service Interface class nameserviceImpls- The Service Interface Implementations class names- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if serviceInterface is nullIllegalArgumentException- if serviceImpls is null or contain null values- See Also:
-
addAsServiceProviderAndClasses
public T addAsServiceProviderAndClasses(Class<?> serviceInterface, Class<?>... serviceImpls) throws IllegalArgumentException Description copied from interface:ServiceProviderContainerAdds a META-INF/services/ServiceInterfaceNameAssetand the classes related to the service to the archive.- Specified by:
addAsServiceProviderAndClassesin interfaceServiceProviderContainer<T extends Archive<T>>- Parameters:
serviceInterface- The Service Interface classserviceImpls- The Service Interface Implementations- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if serviceInterface is nullIllegalArgumentException- if serviceImpls is null or contain null values
-
getResourcePath
Should be implemented to set the path for Resource related resources.- Returns:
- Base Path for the ResourceContainer resources
-
addAsResource
Description copied from interface:ResourceContainerAdds the resource as a resource to the container, returning the container itself.
The resource will be placed into the Container Resource path under the same context from which it was retrieved.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsResourcein interfaceResourceContainer<T extends Archive<T>>- Parameters:
resourceName- resource to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- If the resourceName is null- See Also:
-
addAsResource
Description copied from interface:ResourceContainerAdds theFileas a resource to the container, returning the container itself.
TheFilewill be placed into the Container Library path underFile.getName().- Specified by:
addAsResourcein interfaceResourceContainer<T extends Archive<T>>- Parameters:
resource-Fileresource to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- If the resource is null- See Also:
-
addAsResource
Description copied from interface:ResourceContainerAdds the resource as a resource to the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsResourcein interfaceResourceContainer<T extends Archive<T>>- Parameters:
resourceName- resource to addtarget- The target path within the archive in which to add the resource, relative to theArchives resource path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resourceName is nullIllegalArgumentException- if target is null- See Also:
-
addAsResource
Description copied from interface:ResourceContainerAdds theFileas a resource to the container, returning the container itself.- Specified by:
addAsResourcein interfaceResourceContainer<T extends Archive<T>>- Parameters:
resource-Fileresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives resource path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resource is nullIllegalArgumentException- if target is null- See Also:
-
addAsResource
Description copied from interface:ResourceContainerAdds theURLas a resource to the container, returning the container itself.- Specified by:
addAsResourcein interfaceResourceContainer<T extends Archive<T>>- Parameters:
resource-URLresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives resource path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resource is nullIllegalArgumentException- if target is null- See Also:
-
addAsResource
Description copied from interface:ResourceContainerAdds theAssetas a resource to the container, returning the container itself.- Specified by:
addAsResourcein interfaceResourceContainer<T extends Archive<T>>- Parameters:
resource-Assetresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives resource path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resource is nullIllegalArgumentException- if target is null- See Also:
-
addAsResource
Description copied from interface:ResourceContainerAdds the resource with the specified name to the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsResourcein interfaceResourceContainer<T extends Archive<T>>- Parameters:
resourceName- Name of theClassLoaderresource to addtarget- The target within the archive into which we'll place the resource- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- If the target is nullIllegalArgumentException- If the resourceName is null
-
addAsResource
public T addAsResource(String resourceName, ArchivePath target, ClassLoader classLoader) throws IllegalArgumentException Description copied from interface:ResourceContainerAdds the resource as a resource to the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsResourcein interfaceResourceContainer<T extends Archive<T>>- Parameters:
resourceName- resource to addtarget- The target path within the archive in which to add the resource, relative to theArchives resource path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resourceName is nullIllegalArgumentException- if target is null- See Also:
-
addAsResource
Description copied from interface:ResourceContainerAdds theFileas a resource to the container, returning the container itself.- Specified by:
addAsResourcein interfaceResourceContainer<T extends Archive<T>>- Parameters:
resource-Fileresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives resource path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resource is nullIllegalArgumentException- if target is null- See Also:
-
addAsResource
Description copied from interface:ResourceContainerAdds theURLas a resource to the container, returning the container itself.- Specified by:
addAsResourcein interfaceResourceContainer<T extends Archive<T>>- Parameters:
resource-URLresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives resource path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resource is nullIllegalArgumentException- if target is null- See Also:
-
addAsResource
Description copied from interface:ResourceContainerAdds theAssetas a resource to the container, returning the container itself.- Specified by:
addAsResourcein interfaceResourceContainer<T extends Archive<T>>- Parameters:
resource-Assetresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives resource path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resource is nullIllegalArgumentException- if target is null
-
addAsResources
public T addAsResources(Package resourcePackage, String... resourceNames) throws IllegalArgumentException Description copied from interface:ResourceContainerAdds the resources inside the package as multiple resources to the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsResourcesin interfaceResourceContainer<T extends Archive<T>>- Parameters:
resourcePackage- The package of the resourcesresourceNames- The names of the resources inside resoucePackage- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resourcePackage is nullIllegalArgumentException- if no resourceNames are specified or containing null
-
addAsResource
public T addAsResource(Package resourcePackage, String resourceName) throws IllegalArgumentException Description copied from interface:ResourceContainerAdds the resource as a resource to the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsResourcein interfaceResourceContainer<T extends Archive<T>>- Parameters:
resourcePackage- The package of the resourceresourceName- The name of the resource inside resoucePackage- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resourcePackage is nullIllegalArgumentException- if resourceName is null
-
addAsResource
public T addAsResource(Package resourcePackage, String resourceName, String target) throws IllegalArgumentException Description copied from interface:ResourceContainerAdds the resource as a resource to a specific path inside the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsResourcein interfaceResourceContainer<T extends Archive<T>>- Parameters:
resourcePackage- The package of the resourceresourceName- The name of the resource inside resoucePackagetarget- The target location inside the container- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resourcePackage is nullIllegalArgumentException- if resourceName is nullIllegalArgumentException- if target is null
-
addAsResource
public T addAsResource(Package resourcePackage, String resourceName, ArchivePath target) throws IllegalArgumentException Description copied from interface:ResourceContainerAdds the resource as a resource to a specific path inside the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsResourcein interfaceResourceContainer<T extends Archive<T>>- Parameters:
resourcePackage- The package of the resourceresourceName- The name of the resource inside resoucePackagetarget- The target location inside the container- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resourcePackage is nullIllegalArgumentException- if resourceName is nullIllegalArgumentException- if target is null
-
getClassesPath
Should be implemented to set the path for Class related resources.- Returns:
- Base Path for the ClassContainer resources
-
addClass
Description copied from interface:ClassContainer- Specified by:
addClassin interfaceClassContainer<T extends Archive<T>>- Returns:
- This archive
- Throws:
IllegalArgumentException- If no class were specified
-
addClass
Adds theClass, and all member (inner)Classes, with the specified fully-qualified name, loaded by the Thread ContextClassLoader, to theArchive.- Specified by:
addClassin interfaceClassContainer<T extends Archive<T>>- Parameters:
fullyQualifiedClassName- The name of theClassto add- Returns:
- This archive
- Throws:
IllegalArgumentException- If no class name was specifiedIllegalArgumentException- If theClasscould not be loaded- See Also:
-
addClass
Adds theClass, and all member (inner) @link{Class}es, with the specified fully-qualified name, loaded by the specifiedClassLoader, to theArchive.- Specified by:
addClassin interfaceClassContainer<T extends Archive<T>>- Parameters:
fullyQualifiedClassName- The name of theClassto addcl- TheClassLoaderused to load the Class- Returns:
- This archive
- Throws:
IllegalArgumentException- If no class name was specifiedIllegalArgumentException- If noClassLoaderwas specifiedIllegalArgumentException- If theClasscould not be loaded by the targetClassLoader- See Also:
-
addClasses
Description copied from interface:ClassContainer- Specified by:
addClassesin interfaceClassContainer<T extends Archive<T>>- Parameters:
classes- The classes to add to the Archive- Returns:
- This archive
- Throws:
IllegalArgumentException- If no classes were specified
-
addPackage
Description copied from interface:ClassContainer- Specified by:
addPackagein interfaceClassContainer<T extends Archive<T>>- Parameters:
pack- ThePackageto add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- If no package were specified- See Also:
-
addPackages
Description copied from interface:ClassContainer- Specified by:
addPackagesin interfaceClassContainer<T extends Archive<T>>- Parameters:
recursive- Should the sub packages be addedpackages- All the packages to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- If no packages were specified- See Also:
-
addPackages
public T addPackages(boolean recursive, Filter<ArchivePath> filter, Package... packages) throws IllegalArgumentException Description copied from interface:ClassContainerAdds all classes accepted by the filter in the specifiedPackages to theArchive.
TheArchivePathreturned to the filter is theArchivePathof the class, not the final location.
package.MyClass = /package/MyClass.class
not: package.MyClass = /WEB-INF/classes/package/MyClass.class- Specified by:
addPackagesin interfaceClassContainer<T extends Archive<T>>- Parameters:
recursive- Should the sub packages be addedfilter- filter out specific classespackages- All the packages to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- If no packages were specified
-
addPackages
private T addPackages(boolean recursive, Filter<ArchivePath> filter, ClassLoader cl, Package... packages) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
addPackage
Description copied from interface:ClassContainer- Specified by:
addPackagein interfaceClassContainer<T extends Archive<T>>- Parameters:
pack- Package to add represented by a String ("my/package")- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- If no package were specified- See Also:
-
addDefaultPackage
Description copied from interface:ClassContainer- Specified by:
addDefaultPackagein interfaceClassContainer<T extends Archive<T>>- Returns:
- This virtual archive
-
addPackages
Description copied from interface:ClassContainer- Specified by:
addPackagesin interfaceClassContainer<T extends Archive<T>>- Parameters:
recursive- Should the sub packages be addedpackages- All the packages to add represented by a String ("my/package")- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- If no packages were specified- See Also:
-
addPackages
public T addPackages(boolean recursive, Filter<ArchivePath> filter, String... packageNames) throws IllegalArgumentException Description copied from interface:ClassContainerAdds all classes accepted by the filter in the specifiedPackages to theArchive.
TheArchivePathreturned to the filter is theArchivePathof the class, not the final location.
package.MyClass = /package/MyClass.class
not: package.MyClass = /WEB-INF/classes/package/MyClass.class- Specified by:
addPackagesin interfaceClassContainer<T extends Archive<T>>- Parameters:
recursive- Should the sub packages be addedfilter- filter out specific classespackageNames- All the packages to add represented by a String ("my/package")- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- If no packages were specified
-
addPackages
private T addPackages(boolean recursive, Filter<ArchivePath> filter, ClassLoader classLoader, String... packageNames) -
addPackage
private void addPackage(boolean recursive, Filter<ArchivePath> filter, ClassLoader classLoader, String packageName) -
deleteClass
Description copied from interface:ClassContainer- Specified by:
deleteClassin interfaceClassContainer<T extends Archive<T>>- Returns:
- This archive
- Throws:
IllegalArgumentException- If no class was specified
-
deleteClass
Description copied from interface:ClassContainerDeletes theClass, and all member (inner)Classes, with the specified fully-qualified name, loaded by the Thread ContextClassLoader, from theArchive.- Specified by:
deleteClassin interfaceClassContainer<T extends Archive<T>>- Parameters:
fullyQualifiedClassName- The name of theClassto be deleted- Returns:
- This archive
- Throws:
IllegalArgumentException- If no class name was specifiedIllegalArgumentException- If theClasscould not be loaded
-
deleteClasses
Description copied from interface:ClassContainer- Specified by:
deleteClassesin interfaceClassContainer<T extends Archive<T>>- Parameters:
classes- The classes to be removed from theArchive- Returns:
- This archive
- Throws:
IllegalArgumentException- If no classes were specified
-
getInnerClasses
-
deletePackage
Description copied from interface:ClassContainer- Specified by:
deletePackagein interfaceClassContainer<T extends Archive<T>>- Parameters:
pack- ThePackageto be deleted- Returns:
- This archive
- Throws:
IllegalArgumentException- If no package was specified- See Also:
-
deletePackage
Description copied from interface:ClassContainer- Specified by:
deletePackagein interfaceClassContainer<T extends Archive<T>>- Parameters:
pack- Package to be delete represented by a String ("my/package")- Returns:
- This archive
- Throws:
IllegalArgumentException- If no package was specified- See Also:
-
deleteDefaultPackage
Description copied from interface:ClassContainer- Specified by:
deleteDefaultPackagein interfaceClassContainer<T extends Archive<T>>- Returns:
- This archive
-
deletePackages
Description copied from interface:ClassContainer- Specified by:
deletePackagesin interfaceClassContainer<T extends Archive<T>>- Parameters:
recursive- Should the sub packages be deleted?packages- All the packages to be deleted- Returns:
- This archive
- Throws:
IllegalArgumentException- If no packages were specified- See Also:
-
deletePackages
Description copied from interface:ClassContainer- Specified by:
deletePackagesin interfaceClassContainer<T extends Archive<T>>- Parameters:
recursive- Should the sub packages be deleted?packages- All the packages to be deleted represented by a String ("my/package")- Returns:
- This archive
- Throws:
IllegalArgumentException- If no packages were specified- See Also:
-
deletePackages
public T deletePackages(boolean recursive, Filter<ArchivePath> filter, Package... packages) throws IllegalArgumentException Description copied from interface:ClassContainerDeletes all classes accepted by the filter in the specifiedPackages from theArchive.
TheArchivePathreturned to the filter is theArchivePathof the class, not the final location.
package.MyClass = /package/MyClass.class
not: package.MyClass = /WEB-INF/classes/package/MyClass.class- Specified by:
deletePackagesin interfaceClassContainer<T extends Archive<T>>- Parameters:
recursive- Should the sub packages be deleted?filter- filter out specific classespackages- All the packages to be deleted- Returns:
- This archive
- Throws:
IllegalArgumentException- If no packages were specified or if no filter was specified
-
deletePackages
public T deletePackages(boolean recursive, Filter<ArchivePath> filter, String... packages) throws IllegalArgumentException Description copied from interface:ClassContainerDelete all classes accepted by the filter in the specifiedPackages from theArchive.
TheArchivePathreturned to the filter is theArchivePathof the class, not the final location.
package.MyClass = /package/MyClass.class
not: package.MyClass = /WEB-INF/classes/package/MyClass.class- Specified by:
deletePackagesin interfaceClassContainer<T extends Archive<T>>- Parameters:
recursive- Should the sub packages be deleted?filter- filter out specific classespackages- All the packages to be deleted represented by a String ("my/package")- Returns:
- This archive
- Throws:
IllegalArgumentException- If no packages were specified or if no filter was specified
-
deletePackage
private void deletePackage(boolean recursive, Filter<ArchivePath> filter, String packageName, ClassLoader classLoader) -
getLibraryPath
Should be implemented to set the path for Library related resources.- Returns:
- Base Path for the LibraryContainer resources
-
addAsLibrary
Add anotherArchiveto thisArchiveas a library to the container, returning the container itself.
TheArchivewill be placed into the Container Library path underArchive.getName().- Specified by:
addAsLibraryin interfaceLibraryContainer<T extends Archive<T>>- Parameters:
archive-Archiveresource to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- ifArchiveis null- See Also:
-
addAsLibrary
Adds the resource as a library to the container, returning the container itself.
The resource will be placed into the Container Library path under the same context from which it was retrieved.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsLibraryin interfaceLibraryContainer<T extends Archive<T>>- Parameters:
resourceName- resource to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resourceName is null- See Also:
-
addAsLibrary
Adds theFileas a library to the container, returning the container itself.
TheFilewill be placed into the Container Library path underFile.getName().- Specified by:
addAsLibraryin interfaceLibraryContainer<T extends Archive<T>>- Parameters:
resource-Fileresource to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resourceName is null- See Also:
-
addAsLibrary
Adds the resource as a library to the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsLibraryin interfaceLibraryContainer<T extends Archive<T>>- Parameters:
resourceName- resource to addtarget- The target path within the archive in which to add the resource, relative to theArchives library path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resourceName is nullIllegalArgumentException- if target is null- See Also:
-
addAsLibrary
Adds theFileas a library to the container, returning the container itself.- Specified by:
addAsLibraryin interfaceLibraryContainer<T extends Archive<T>>- Parameters:
resource-Fileresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives library path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resource is nullIllegalArgumentException- if target is null- See Also:
-
addAsLibrary
Description copied from interface:LibraryContainerAdds theURLas a library to the container, returning the container itself.- Specified by:
addAsLibraryin interfaceLibraryContainer<T extends Archive<T>>- Parameters:
resource-URLresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives library path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resource is nullIllegalArgumentException- if target is null- See Also:
-
addAsLibrary
Description copied from interface:LibraryContainerAdds theAssetas a library to the container, returning the container itself.- Specified by:
addAsLibraryin interfaceLibraryContainer<T extends Archive<T>>- Parameters:
resource-Assetresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives library path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resource is nullIllegalArgumentException- if target is null- See Also:
-
addAsLibrary
Description copied from interface:LibraryContainerAdds the resource as a library to the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsLibraryin interfaceLibraryContainer<T extends Archive<T>>- Parameters:
resourceName- resource to addtarget- The target path within the archive in which to add the resource, relative to theArchives library path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resourceName is nullIllegalArgumentException- if target is null- See Also:
-
addAsLibrary
Description copied from interface:LibraryContainerAdds theFileas a library to the container, returning the container itself.- Specified by:
addAsLibraryin interfaceLibraryContainer<T extends Archive<T>>- Parameters:
resource-Fileresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives library path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resource is nullIllegalArgumentException- if target is null- See Also:
-
addAsLibrary
Description copied from interface:LibraryContainerAdds theURLas a library to the container, returning the container itself.- Specified by:
addAsLibraryin interfaceLibraryContainer<T extends Archive<T>>- Parameters:
resource-URLresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives library path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resource is nullIllegalArgumentException- if target is null- See Also:
-
addAsLibrary
Description copied from interface:LibraryContainerAdds theAssetas a library to the container, returning the container itself.- Specified by:
addAsLibraryin interfaceLibraryContainer<T extends Archive<T>>- Parameters:
resource-Assetresource to addtarget- The target path within the archive in which to add the resource, relative to theArchives library path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resource is nullIllegalArgumentException- if target is null
-
addAsLibraries
Description copied from interface:LibraryContainerAdd multiple resources to thisArchiveas libraries to the container, returning the container itself.
The resources will be placed into the Container Library path under the same context from which they were retrieved.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsLibrariesin interfaceLibraryContainer<T extends Archive<T>>- Parameters:
resourceNames- resources to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resourceNames are null or empty- See Also:
-
addAsLibraries
Description copied from interface:LibraryContainerAdd multipleFileto thisArchiveas libraries to the container, returning the container itself.
TheFiles will be placed into the Container Library path underFile.getName().- Specified by:
addAsLibrariesin interfaceLibraryContainer<T extends Archive<T>>- Parameters:
resources-Fileresources to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- ifFileresources are null or empty- See Also:
-
addAsLibraries
Description copied from interface:LibraryContainerAdd multipleArchives to thisArchiveas libraries to the container, returning the container itself.
TheArchives will be placed into the Container Library path underArchive.getName().- Specified by:
addAsLibrariesin interfaceLibraryContainer<T extends Archive<T>>- Parameters:
archives-Archiveresources to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- ifArchiveresources are null- See Also:
-
addAsLibraries
Add multipleArchives to thisArchiveas libraries to the container, returning the container itself.
TheArchives will be placed into the Container Library path underArchive.getName().- Specified by:
addAsLibrariesin interfaceLibraryContainer<T extends Archive<T>>- Parameters:
archives-Archiveresources to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- ifCollectionof archives is null- See Also:
-
addAsLibraries
Add multipleArchives to thisArchiveas libraries to the container, returning the container itself.
TheArchives will be placed into the Container Library path underArchive.getName().- Specified by:
addAsLibrariesin interfaceLibraryContainer<T extends Archive<T>>- Parameters:
archives-Archiveresources to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- ifCollectionof archives is null- See Also:
-
writeTo
Prints the content of thisArchiveto the specifiedOutputStreamon the format defined by the specifiedFormatter. The caller is responsible for opening, flushing and eventually closing the stream. -
covarientReturn
-
getActualClass
-
fileFromResource
Gets a resource from the TCCL and returns its file path.- Parameters:
resourceName- is the name of the resource in the classpath- Returns:
- the file path for resourceName @see
URL.getFile() - Throws:
IllegalArgumentException- if resourceName doesn't exist in the classpath or privileges are not granted
-
getArchiveClassLoaders
-