@Service(name="jar") @PerLookup public class InputJarArchive extends JarArchive implements ReadableArchive
| Modifier and Type | Field and Description |
|---|---|
static Logger |
deplLogger |
protected JarFile |
jarFile |
protected JarInputStream |
jarIS |
archiveMetaData, extraData| Constructor and Description |
|---|
InputJarArchive() |
| Modifier and Type | Method and Description |
|---|---|
OutputStream |
addEntry(String name) |
void |
close()
close the abstract archive
|
void |
create(URI uri)
creates a new abstract archive with the given path
|
boolean |
delete()
deletes the underlying jar file
|
Enumeration<String> |
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
|
Collection<String> |
getDirectories()
Returns the collection of first level directories in this
archive.
|
InputStream |
getEntry(String entryName)
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) |
protected static JarFile |
getJarFile(URI uri) |
Manifest |
getManifest()
Returns the manifest information for 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
|
void |
open(URI uri)
Open an abstract archive
|
boolean |
renameTo(String name)
rename the underlying jar file
|
addArchiveMetaData, entries, getArchiveMetaData, getExtraData, getName, getParentArchive, isDirectory, removeArchiveMetaData, removeExtraData, setExtraData, setParentArchiveclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddArchiveMetaData, getArchiveMetaData, getExtraData, getParentArchive, removeArchiveMetaData, removeExtraData, setExtraData, setParentArchiveentries, getName, isDirectorypublic static final Logger deplLogger
protected volatile JarFile jarFile
protected volatile JarInputStream jarIS
public long getArchiveSize()
throws NullPointerException,
SecurityException
getArchiveSize in interface ArchiveNullPointerExceptionSecurityExceptionpublic OutputStream addEntry(String name) throws IOException
name - the entry nameIOExceptionpublic void close()
throws IOException
close in interface ArchiveIOExceptionpublic Collection<String> getDirectories() throws IOException
Avoid having to fetch all the entries if we can avoid it. The only time we must do that is if size() is invoked on the collection. Use the CollectionWrappedEnumeration for this optimization which will create a full in-memory list of the entries only if and when needed to satisfy the size() method.
getDirectories in interface ArchiveIOExceptionpublic void create(URI uri) throws IOException
uri - the path to create the archiveIOExceptionpublic Enumeration<String> entries()
Archivepublic Enumeration entries(Enumeration embeddedArchives)
public JarEntry getJarEntry(String name)
getJarEntry in class JarArchivepublic boolean exists(String name) throws IOException
exists in interface ReadableArchiveexists in class JarArchivename - the file name relative to the root of the module. * @return the existence the given entry name.IOExceptionpublic InputStream getEntry(String entryName) throws IOException
ReadableArchivegetEntry in interface ReadableArchiveentryName - entry nameIOExceptionpublic long getEntrySize(String name)
getEntrySize in interface ReadableArchivename - the entry namepublic void open(URI uri) throws IOException
open in interface ReadableArchiveuri - the path to the archiveIOExceptionprotected static JarFile getJarFile(URI uri) throws IOException
IOExceptionpublic Manifest getManifest() throws IOException
ArchivegetManifest in interface ArchiveIOExceptionpublic URI getURI()
public boolean exists()
exists in interface ReadableArchivepublic boolean delete()
delete in interface ReadableArchivepublic boolean renameTo(String name)
renameTo in interface ReadableArchivename - the archive namepublic ReadableArchive getSubArchive(String name) throws IOException
ReadableArchivegetSubArchive in interface ReadableArchivename - is the entry name relative to the root for the archiveIOExceptionCopyright © 2017. All rights reserved.