public abstract class ArchiveBase<T extends Archive<T>> extends Object implements Archive<T>, Configurable, ArchiveFormatAssociable, Identifiable
Archive
. Contains support for operations (typically overloaded) that are not specific
to any particular storage implementation, and may be delegated to other forms.Modifier | Constructor and Description |
---|---|
protected |
ArchiveBase(String name,
Configuration configuration)
Constructor
Creates a new Archive with the specified name
|
Modifier and Type | Method and Description |
---|---|
T |
add(Archive<?> archive,
ArchivePath path,
Class<? extends StreamExporter> exporter) |
T |
add(Asset asset,
ArchivePath path,
String name) |
T |
add(Asset asset,
String target) |
T |
add(Asset asset,
String target,
String name) |
T |
add(NamedAsset namedAsset) |
T |
addAsDirectories(ArchivePath... paths) |
T |
addAsDirectories(String... paths) |
T |
addAsDirectory(String path) |
<TYPE extends Assignable> |
as(Class<TYPE> clazz) |
protected T |
covariantReturn()
Provides typesafe covariant return of this instance
|
boolean |
equals(Object obj) |
Node |
get(String path) |
protected abstract Class<T> |
getActualClass()
Exposes the actual class used in casting
|
ArchiveFormat |
getArchiveFormat() |
<X extends Archive<X>> |
getAsType(Class<X> type,
ArchivePath path) |
<X extends Archive<X>> |
getAsType(Class<X> type,
ArchivePath path,
ArchiveFormat archiveFormat) |
<X extends Archive<X>> |
getAsType(Class<X> type,
Filter<ArchivePath> filter) |
<X extends Archive<X>> |
getAsType(Class<X> type,
Filter<ArchivePath> filter,
ArchiveFormat archiveFormat) |
<X extends Archive<X>> |
getAsType(Class<X> type,
String path) |
<X extends Archive<X>> |
getAsType(Class<X> type,
String path,
ArchiveFormat archiveFormat) |
Configuration |
getConfiguration() |
String |
getId() |
String |
getName() |
int |
hashCode() |
T |
merge(Archive<?> source) |
T |
merge(Archive<?> source,
ArchivePath path) |
T |
merge(Archive<?> source,
ArchivePath path,
Filter<ArchivePath> filter) |
T |
merge(Archive<?> source,
Filter<ArchivePath> filter) |
T |
merge(Archive<?> source,
String path) |
T |
merge(Archive<?> source,
String path,
Filter<ArchivePath> filter) |
T |
move(ArchivePath source,
ArchivePath target) |
T |
move(String source,
String target) |
void |
setId(String id) |
Archive<T> |
shallowCopy() |
String |
toString() |
String |
toString(boolean verbose) |
String |
toString(Formatter formatter) |
void |
writeTo(OutputStream outputStream,
Formatter formatter) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
add, add, addAsDirectory, addHandlers, contains, contains, delete, delete, get, getContent, getContent
protected ArchiveBase(String name, Configuration configuration) throws IllegalArgumentException
name
- Name of the archiveconfiguration
- The configuration for this archiveIllegalArgumentException
- If the name was not specifiedpublic ArchiveFormat getArchiveFormat()
getArchiveFormat
in interface ArchiveFormatAssociable
ArchiveFormatAssociable.getArchiveFormat()
public T add(Asset asset, String target) throws IllegalArgumentException
public T add(Asset asset, String target, String name) throws IllegalArgumentException
add
in interface Archive<T extends Archive<T>>
IllegalArgumentException
Archive.add(org.jboss.shrinkwrap.api.asset.Asset, java.lang.String,
java.lang.String)
public T add(Asset asset, ArchivePath path, String name)
public Node get(String path) throws IllegalArgumentException
get
in interface Archive<T extends Archive<T>>
IllegalArgumentException
Archive.get(java.lang.String)
public <X extends Archive<X>> Collection<X> getAsType(Class<X> type, Filter<ArchivePath> filter)
public <X extends Archive<X>> X getAsType(Class<X> type, ArchivePath path)
public <X extends Archive<X>> X getAsType(Class<X> type, String path, ArchiveFormat archiveFormat)
public <X extends Archive<X>> X getAsType(Class<X> type, ArchivePath path, ArchiveFormat archiveFormat)
public <X extends Archive<X>> Collection<X> getAsType(Class<X> type, Filter<ArchivePath> filter, ArchiveFormat archiveFormat)
public T add(Archive<?> archive, ArchivePath path, Class<? extends StreamExporter> exporter)
public T add(NamedAsset namedAsset)
public T addAsDirectory(String path) throws IllegalArgumentException
addAsDirectory
in interface Archive<T extends Archive<T>>
IllegalArgumentException
Archive.addAsDirectory(java.lang.String)
public T addAsDirectories(ArchivePath... paths) throws IllegalArgumentException
addAsDirectories
in interface Archive<T extends Archive<T>>
IllegalArgumentException
Archive.addAsDirectories(org.jboss.shrinkwrap.api.ArchivePath[])
public T addAsDirectories(String... paths) throws IllegalArgumentException
addAsDirectories
in interface Archive<T extends Archive<T>>
IllegalArgumentException
Archive.addAsDirectories(java.lang.String[])
public final String getName()
public String getId()
getId
in interface Archive<T extends Archive<T>>
getId
in interface Identifiable
Archive.getId()
public void setId(String id) throws IllegalArgumentException
setId
in interface Identifiable
IllegalArgumentException
public T merge(Archive<?> source) throws IllegalArgumentException
merge
in interface Archive<T extends Archive<T>>
IllegalArgumentException
Archive.merge(org.jboss.shrinkwrap.api.Archive)
public T merge(Archive<?> source, Filter<ArchivePath> filter) throws IllegalArgumentException
merge
in interface Archive<T extends Archive<T>>
IllegalArgumentException
Archive.merge(org.jboss.shrinkwrap.api.Archive, org.jboss.shrinkwrap.api.Filter)
public T merge(Archive<?> source, ArchivePath path) throws IllegalArgumentException
public T merge(Archive<?> source, String path, Filter<ArchivePath> filter) throws IllegalArgumentException
merge
in interface Archive<T extends Archive<T>>
IllegalArgumentException
Archive.merge(org.jboss.shrinkwrap.api.Archive, java.lang.String,
org.jboss.shrinkwrap.api.Filter)
public T merge(Archive<?> source, String path) throws IllegalArgumentException
merge
in interface Archive<T extends Archive<T>>
IllegalArgumentException
Archive.merge(org.jboss.shrinkwrap.api.Archive, java.lang.String)
public final Archive<T> shallowCopy()
shallowCopy
in interface Archive<T extends Archive<T>>
Archive.shallowCopy()
public T merge(Archive<?> source, ArchivePath path, Filter<ArchivePath> filter) throws IllegalArgumentException
public T move(ArchivePath source, ArchivePath target) throws IllegalArgumentException, IllegalArchivePathException
move
in interface Archive<T extends Archive<T>>
IllegalArgumentException
IllegalArchivePathException
Archive.move(org.jboss.shrinkwrap.api.ArchivePath, org.jboss.shrinkwrap.api.ArchivePath)
public T move(String source, String target) throws IllegalArgumentException, IllegalArchivePathException
move
in interface Archive<T extends Archive<T>>
IllegalArgumentException
IllegalArchivePathException
Archive.move(java.lang.String, java.lang.String)
public <TYPE extends Assignable> TYPE as(Class<TYPE> clazz)
as
in interface Assignable
Assignable.as(java.lang.Class)
public String toString()
public String toString(boolean verbose)
public String toString(Formatter formatter) throws IllegalArgumentException
toString
in interface Archive<T extends Archive<T>>
IllegalArgumentException
Archive.toString(org.jboss.shrinkwrap.api.formatter.Formatter)
public void writeTo(OutputStream outputStream, Formatter formatter) throws IllegalArgumentException
public int hashCode()
public boolean equals(Object obj)
public Configuration getConfiguration()
getConfiguration
in interface Configurable
Configurable.getConfiguration()
protected abstract Class<T> getActualClass()
protected final T covariantReturn()
Copyright © 2013 JBoss by Red Hat. All Rights Reserved.