public abstract class JarArchive extends Object implements Archive
Modifier and Type | Field and Description |
---|---|
protected Map<String,Object> |
archiveMetaData |
protected Map<Class<?>,Object> |
extraData |
protected ReadableArchive |
parentArchive |
Constructor and Description |
---|
JarArchive() |
Modifier and Type | Method and Description |
---|---|
void |
addArchiveMetaData(String metaDataKey,
Object metaData) |
Enumeration<String> |
entries(String prefix)
Returns an enumeration of the module file entries with the
specified prefix.
|
boolean |
exists(String name)
Returns the existence of the given entry name
The file name must be relative to the root of the module.
|
<T> T |
getArchiveMetaData(String metaDataKey,
Class<T> metadataType) |
<U> U |
getExtraData(Class<U> dataType)
Returns any data that could have been calculated as part of
the descriptor loading.
|
protected abstract JarEntry |
getJarEntry(String entryName) |
String |
getName()
Returns the name portion of the archive's URI.
|
ReadableArchive |
getParentArchive()
get the parent archive of this archive
|
boolean |
isDirectory(String name)
Returns true if the entry is a directory or a plain file
|
void |
removeArchiveMetaData(String metaDataKey) |
<U> void |
removeExtraData(Class<U> dataType) |
<U> void |
setExtraData(Class<U> dataType,
U instance) |
void |
setParentArchive(ReadableArchive parentArchive)
set the parent archive for this archive
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, entries, getArchiveSize, getDirectories, getManifest, getURI
protected ReadableArchive parentArchive
public Enumeration<String> entries(String prefix)
public String getName()
For JarArhive the name is all of the path that follows the last slash up to but not including the last dot.
Here are some example archive names for the specified JarArchive paths:
public boolean exists(String name) throws IOException
name
- the file name relative to the root of the module. * @return the existence the given entry name.IOException
public boolean isDirectory(String name)
isDirectory
in interface Archive
name
- name is one of the entries returned by Archive.entries()
public void setParentArchive(ReadableArchive parentArchive)
parentArchive
- the parent archivepublic ReadableArchive getParentArchive()
public <U> U getExtraData(Class<U> dataType)
dataType
- the type of the extra datapublic <U> void setExtraData(Class<U> dataType, U instance)
public <U> void removeExtraData(Class<U> dataType)
public void removeArchiveMetaData(String metaDataKey)
Copyright © 2018. All rights reserved.