@Service @PerLookup public class MemoryMappedArchive extends JarArchive implements ReadableArchive
archiveMetaData, extraData, parentArchive| Modifier | Constructor and Description |
|---|---|
protected |
MemoryMappedArchive()
Creates a new instance of MemoryMappedArchive
|
|
MemoryMappedArchive(byte[] bits) |
|
MemoryMappedArchive(InputStream is)
Creates a new instance of MemoryMappedArchive
|
|
MemoryMappedArchive(ReadableArchive source) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
close the abstract archive
|
boolean |
delete()
delete the archive
|
Enumeration |
entries()
Returns an enumeration of the module file entries.
|
Enumeration |
entries(Enumeration embeddedArchives) |
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()
Get the size of the archive
|
byte[] |
getByteArray() |
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
|
JarEntry |
getJarEntry(String name) |
Manifest |
getManifest()
Returns the manifest information for this archive
|
String |
getName()
Returns the name for the archive.
|
String |
getPath() |
ReadableArchive |
getSubArchive(String name)
create or obtain an embedded archive within this abstraction.
|
URI |
getURI()
Returns the path used to create or open the underlying archive
|
void |
open(URI uri)
Open an abstract archive
|
boolean |
renameTo(String name)
rename the archive
|
void |
setURI(URI uri) |
addArchiveMetaData, entries, getArchiveMetaData, getExtraData, getParentArchive, isDirectory, removeArchiveMetaData, removeExtraData, setExtraData, setParentArchiveclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddArchiveMetaData, getArchiveMetaData, getExtraData, getParentArchive, removeArchiveMetaData, removeExtraData, setExtraData, setParentArchiveentries, isDirectoryprotected MemoryMappedArchive()
public MemoryMappedArchive(InputStream is) throws IOException
IOExceptionpublic MemoryMappedArchive(byte[] bits)
public MemoryMappedArchive(ReadableArchive source) throws IOException
IOExceptionpublic byte[] getByteArray()
public void open(URI uri) throws IOException
ReadableArchiveopen in interface ReadableArchiveuri - path to the archiveIOExceptionpublic void close()
throws IOException
close in interface ArchiveIOExceptionpublic boolean delete()
delete in interface ReadableArchivepublic Enumeration entries()
Archivepublic Collection<String> getDirectories() throws IOException
ArchivegetDirectories in interface ArchiveIOExceptionpublic Enumeration entries(Enumeration embeddedArchives)
public boolean exists()
exists in interface ReadableArchivepublic String getPath()
public long getArchiveSize()
throws NullPointerException,
SecurityException
getArchiveSize in interface ArchiveNullPointerExceptionSecurityExceptionpublic 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 void setURI(URI uri)
public ReadableArchive getSubArchive(String name) throws IOException
getSubArchive in interface ReadableArchivename - the name of the embedded archive.IOExceptionpublic boolean exists(String name) throws IOException
exists in interface ReadableArchiveexists in class JarArchivename - the file name relative to the root of the module.IOExceptionpublic InputStream getEntry(String name) throws IOException
ReadableArchivegetEntry in interface ReadableArchivename - the entry nameIOExceptionpublic JarEntry getJarEntry(String name)
getJarEntry in class JarArchivepublic long getEntrySize(String name)
getEntrySize in interface ReadableArchivename - the entry namepublic Manifest getManifest() throws IOException
ArchivegetManifest in interface ArchiveIOExceptionpublic boolean renameTo(String name)
renameTo in interface ReadableArchivename - the archive namepublic String getName()
For a MemoryMappedArhive there is no name, so an empty string is returned.
getName in interface ArchivegetName in class JarArchiveCopyright © 2019. All rights reserved.