T
- public abstract class MemoryMapArchiveBase<T extends Archive<T>> extends ArchiveBase<T> implements Archive<T>
Constructor and Description |
---|
MemoryMapArchiveBase(Configuration configuration)
Constructor
This constructor will generate a unique
Archive.getName() per instance. |
MemoryMapArchiveBase(String archiveName,
Configuration configuration)
Constructor
This constructor will generate an
Archive with the provided name. |
Modifier and Type | Method and Description |
---|---|
T |
add(Archive<?> archive,
ArchivePath path,
Class<? extends StreamExporter> exporter)
Add an archive under a specific context and maintain the archive name as context path.
|
T |
add(Archive<?> archive,
String path,
Class<? extends StreamExporter> exporter)
Add an archive under a specific context and maintain the archive name as context path.
|
T |
add(Asset asset,
ArchivePath path)
Adds the specified asset under the specified path into the target context
|
T |
addAsDirectory(ArchivePath path)
Adds the specified directory.
|
T |
addHandlers(ArchiveEventHandler... handlers)
Add an array of listeners for call back based.
|
boolean |
contains(ArchivePath path)
Denotes whether this archive contains a resource at the specified path
|
boolean |
contains(String path)
Denotes whether this archive contains a resource at the specified path
|
Node |
delete(ArchivePath path)
|
Node |
delete(String archivePath)
|
Node |
get(ArchivePath path)
Obtains the
Node located at the specified path |
Map<ArchivePath,Node> |
getContent()
Obtains all assets in this archive, along with their respective paths.
|
Map<ArchivePath,Node> |
getContent(Filter<ArchivePath> filter)
Obtains all assets matching given filter in this archive, along with its respective Path.
|
add, add, add, add, addAsDirectories, addAsDirectories, addAsDirectory, as, covariantReturn, equals, filter, get, getActualClass, getArchiveFormat, getAsType, getAsType, getAsType, getAsType, getAsType, getAsType, getConfiguration, getId, getName, hashCode, merge, merge, merge, merge, merge, merge, move, move, setId, shallowCopy, shallowCopy, toString, toString, toString, writeTo
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
add, add, add, add, addAsDirectories, addAsDirectories, addAsDirectory, filter, get, getAsType, getAsType, getAsType, getAsType, getAsType, getAsType, getId, getName, merge, merge, merge, merge, merge, merge, move, move, shallowCopy, shallowCopy, toString, toString, toString, writeTo
as
public MemoryMapArchiveBase(Configuration configuration) throws IllegalArgumentException
Archive.getName()
per instance.configuration
- The configuration for this archiveIllegalArgumentException
- If the configuration is not specifiedpublic MemoryMapArchiveBase(String archiveName, Configuration configuration) throws IllegalArgumentException
Archive
with the provided name.archiveName
- configuration
- The configuration for this archiveIllegalArgumentException
- If the name or configuration is not specifiedpublic T add(Asset asset, ArchivePath path)
public T add(Archive<?> archive, String path, Class<? extends StreamExporter> exporter)
add
in interface Archive<T extends Archive<T>>
archive
- to addpath
- to useexporter
- Exporter type to use in fulfilling the Asset.openStream()
contract for the added (nested)
archive.Archive.add(org.jboss.shrinkwrap.api.Archive, java.lang.String, java.lang.Class)
public T add(Archive<?> archive, ArchivePath path, Class<? extends StreamExporter> exporter)
add
in interface Archive<T extends Archive<T>>
add
in class ArchiveBase<T extends Archive<T>>
archive
- to addpath
- to useexporter
- Exporter type to use in fulfilling the Asset.openStream()
contract for the added (nested)
archive.ArchiveBase.add(org.jboss.shrinkwrap.api.Archive,
org.jboss.shrinkwrap.api.ArchivePath, java.lang.Class)
public T addAsDirectory(ArchivePath path) throws IllegalArgumentException
addAsDirectory
in interface Archive<T extends Archive<T>>
path
- The path to addIllegalArgumentException
- If no path was specifiedArchive.addAsDirectory(org.jboss.shrinkwrap.api.ArchivePath)
public T addHandlers(ArchiveEventHandler... handlers)
addHandlers
in interface Archive<T extends Archive<T>>
org.jboss.shrinkwrap.api.Archive#addListener(org.jboss.shrinkwrap.api.Filter, org.jboss.shrinkwrap.api.ArchiveEventHandler)
public boolean contains(ArchivePath path)
public boolean contains(String path) throws IllegalArgumentException
contains
in interface Archive<T extends Archive<T>>
IllegalArgumentException
- If the path is not specifiedArchive.contains(java.lang.String)
public Node delete(ArchivePath path)
Node
in the Archive
at the specified ArchivePath
. If the path is a directory,
recursively removes all contents. If the path does not exist, return null.public Node delete(String archivePath)
Node
in the Archive
at the ArchivePath
indicated by the specified String
archivePath. If the path is a directory, recursively removes all contents. If the path does not exist, return
null.public Node get(ArchivePath path)
Node
located at the specified pathpublic Map<ArchivePath,Node> getContent()
getContent
in interface Archive<T extends Archive<T>>
Archive.getContent()
public Map<ArchivePath,Node> getContent(Filter<ArchivePath> filter)
getContent
in interface Archive<T extends Archive<T>>
Archive.getContent(org.jboss.shrinkwrap.api.Filter)
Copyright © 2016 JBoss by Red Hat. All rights reserved.