@Service(name="jar") @PerLookup public class InputJarArchive extends JarArchive implements org.glassfish.api.deployment.archive.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() |
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) |
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() |
org.glassfish.api.deployment.archive.ReadableArchive |
getSubArchive(String name) |
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, waitpublic static final Logger deplLogger
protected volatile JarFile jarFile
protected volatile JarInputStream jarIS
public long getArchiveSize()
throws NullPointerException,
SecurityException
getArchiveSize in interface org.glassfish.api.deployment.archive.ArchiveNullPointerExceptionSecurityExceptionpublic OutputStream addEntry(String name) throws IOException
name - the entry nameIOExceptionpublic void close()
throws IOException
close in interface org.glassfish.api.deployment.archive.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 org.glassfish.api.deployment.archive.ArchiveIOExceptionpublic void create(URI uri) throws IOException
uri - the path to create the archiveIOExceptionpublic Enumeration<String> entries()
entries in interface org.glassfish.api.deployment.archive.Archivepublic Enumeration entries(Enumeration embeddedArchives)
public JarEntry getJarEntry(String name)
getJarEntry in class JarArchivepublic boolean exists(String name) throws IOException
exists in interface org.glassfish.api.deployment.archive.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
getEntry in interface org.glassfish.api.deployment.archive.ReadableArchiveentryName - entry nameIOExceptionpublic long getEntrySize(String name)
getEntrySize in interface org.glassfish.api.deployment.archive.ReadableArchivename - the entry namepublic void open(URI uri) throws IOException
open in interface org.glassfish.api.deployment.archive.ReadableArchiveuri - the path to the archiveIOExceptionprotected static JarFile getJarFile(URI uri) throws IOException
IOExceptionpublic Manifest getManifest() throws IOException
getManifest in interface org.glassfish.api.deployment.archive.ArchiveIOExceptionpublic URI getURI()
getURI in interface org.glassfish.api.deployment.archive.Archivepublic boolean exists()
exists in interface org.glassfish.api.deployment.archive.ReadableArchivepublic boolean delete()
delete in interface org.glassfish.api.deployment.archive.ReadableArchivepublic boolean renameTo(String name)
renameTo in interface org.glassfish.api.deployment.archive.ReadableArchivepublic org.glassfish.api.deployment.archive.ReadableArchive getSubArchive(String name) throws IOException
getSubArchive in interface org.glassfish.api.deployment.archive.ReadableArchiveIOExceptionCopyright © 2017–2019 Eclipse Foundation. All rights reserved.