@Service @PerLookup public class MultiReadableArchive extends AbstractReadableArchive
archiveMetaData, extraData| Constructor and Description |
|---|
MultiReadableArchive() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
closes this archive and releases all resources
|
boolean |
delete()
deletes the archive
|
Enumeration<String> |
entries()
Returns an enumeration of the module file entries.
|
Enumeration<String> |
entries(String prefix)
Returns an enumeration of the module file entries with the
specified prefix.
|
boolean |
exists() |
boolean |
exists(String name)
Returns the existence of the given entry name
The file name must be relative to the root of the module.
|
long |
getArchiveSize()
Returns the size of the archive.
|
Collection<String> |
getDirectories()
Returns the enumeration of first level directories in this
archive
|
InputStream |
getEntry(String name)
Returns the InputStream for the given entry name
The file name must be relative to the root of the module.
|
long |
getEntrySize(String name)
Returns the entry size for a given entry name or 0 if not known
|
Manifest |
getManifest()
Returns the manifest information for this archive
|
String |
getName()
Returns the name of the archive.
|
ReadableArchive |
getParentArchive()
get the parent archive of this archive
|
ReadableArchive |
getSubArchive(String name)
Returns an instance of this archive abstraction for an embedded
archive within this archive.
|
URI |
getURI()
Returns the path used to create or open the underlying archive
|
URI |
getURI(int slot) |
boolean |
isDirectory(String name)
Returns true if the entry is a directory or a plain file
|
void |
open(URI... uris) |
void |
open(URI uri)
Open an abstract archive
|
boolean |
renameTo(String name)
rename the archive
|
void |
setParentArchive(ReadableArchive parentArchive)
set the parent archive for this archive
|
addArchiveMetaData, getArchiveMetaData, getExtraData, removeArchiveMetaData, removeExtraData, setExtraDatapublic InputStream getEntry(String name) throws IOException
ReadableArchivename - the file name relative to the root of the module.IOExceptionpublic boolean exists(String name) throws IOException
ReadableArchivename - the file name relative to the root of the module.IOExceptionpublic long getEntrySize(String name)
ReadableArchivename - the entry namepublic void open(URI uri) throws IOException
ReadableArchiveuri - path to the archiveIOExceptionpublic void open(URI... uris) throws IOException
IOExceptionpublic ReadableArchive getSubArchive(String name) throws IOException
ReadableArchivename - is the entry name relative to the root for the archiveIOExceptionpublic boolean exists()
public boolean delete()
ReadableArchivepublic boolean renameTo(String name)
ReadableArchivename - the archive namepublic void setParentArchive(ReadableArchive parentArchive)
AbstractReadableArchivesetParentArchive in interface ReadableArchivesetParentArchive in class AbstractReadableArchiveparentArchive - the parent archivepublic ReadableArchive getParentArchive()
AbstractReadableArchivegetParentArchive in interface ReadableArchivegetParentArchive in class AbstractReadableArchivepublic void close()
throws IOException
ArchiveIOExceptionpublic Enumeration<String> entries()
Archivepublic Enumeration<String> entries(String prefix)
Archiveprefix - the prefix of entries to be includedpublic Collection<String> getDirectories() throws IOException
ArchiveIOExceptionpublic boolean isDirectory(String name)
Archivename - name is one of the entries returned by Archive.entries()public Manifest getManifest() throws IOException
ArchiveIOExceptionpublic URI getURI()
Archive
TODO: abstraction breakage:
Several callers, most notably DeploymentContext.getSourceDir()
implementation, assumes that this URI is an URL, and in fact file URL.
If this needs to be URL, use of URI is misleading. And furthermore,
if its needs to be a file URL, this should be File.
public URI getURI(int slot)
public long getArchiveSize()
throws SecurityException
ArchiveSecurityExceptionCopyright © 2019. All rights reserved.