|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.enterprise.deployment.deploy.shared.JarArchive
com.sun.enterprise.deployment.deploy.shared.InputJarArchive
@Service(name="jar") @Scoped(value=org.jvnet.hk2.component.PerLookup.class) public class InputJarArchive
This implementation of the Archive deal with reading jar files either from a JarFile or from a JarInputStream
| Field Summary | |
|---|---|
protected java.util.jar.JarFile |
jarFile
|
protected java.util.jar.JarInputStream |
jarIS
|
| Fields inherited from class com.sun.enterprise.deployment.deploy.shared.JarArchive |
|---|
extraData |
| Constructor Summary | |
|---|---|
InputJarArchive()
|
|
| Method Summary | |
|---|---|
java.io.OutputStream |
addEntry(java.lang.String name)
|
void |
close()
close the abstract archive |
void |
create(java.net.URI uri)
creates a new abstract archive with the given path |
boolean |
delete()
deletes the underlying jar file |
java.util.Enumeration<java.lang.String> |
entries()
|
java.util.Enumeration |
entries(java.util.Enumeration embeddedArchives)
|
boolean |
exists()
|
boolean |
exists(java.lang.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 |
java.util.Collection<java.lang.String> |
getDirectories()
Returns the collection of first level directories in this archive. |
java.io.InputStream |
getEntry(java.lang.String entryName)
|
long |
getEntrySize(java.lang.String name)
Returns the entry size for a given entry name or 0 if not known |
java.util.jar.JarEntry |
getJarEntry(java.lang.String name)
|
protected static java.util.jar.JarFile |
getJarFile(java.net.URI uri)
|
java.util.jar.Manifest |
getManifest()
|
ReadableArchive |
getSubArchive(java.lang.String name)
|
java.net.URI |
getURI()
Returns the path used to create or open the underlying archive |
void |
open(java.net.URI uri)
Open an abstract archive |
boolean |
renameTo(java.lang.String name)
rename the underlying jar file |
| Methods inherited from class com.sun.enterprise.deployment.deploy.shared.JarArchive |
|---|
entries, getExtraData, getName, getParentArchive, isDirectory, removeExtraData, setExtraData, setParentArchive |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.glassfish.api.deployment.archive.ReadableArchive |
|---|
getExtraData, getParentArchive, removeExtraData, setExtraData, setParentArchive |
| Methods inherited from interface org.glassfish.api.deployment.archive.Archive |
|---|
entries, getName, isDirectory |
| Field Detail |
|---|
protected volatile java.util.jar.JarFile jarFile
protected volatile java.util.jar.JarInputStream jarIS
| Constructor Detail |
|---|
public InputJarArchive()
| Method Detail |
|---|
public long getArchiveSize()
throws java.lang.NullPointerException,
java.lang.SecurityException
getArchiveSize in interface Archivejava.lang.NullPointerException
java.lang.SecurityException
public java.io.OutputStream addEntry(java.lang.String name)
throws java.io.IOException
name - the entry name
java.io.IOException
public void close()
throws java.io.IOException
close in interface Archivejava.io.IOException
public java.util.Collection<java.lang.String> getDirectories()
throws java.io.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 Archivejava.io.IOException
public void create(java.net.URI uri)
throws java.io.IOException
uri - the path to create the archive
java.io.IOExceptionpublic java.util.Enumeration<java.lang.String> entries()
entries in interface Archivepublic java.util.Enumeration entries(java.util.Enumeration embeddedArchives)
public java.util.jar.JarEntry getJarEntry(java.lang.String name)
getJarEntry in class JarArchive
public boolean exists(java.lang.String name)
throws java.io.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.
java.io.IOException
public java.io.InputStream getEntry(java.lang.String entryName)
throws java.io.IOException
getEntry in interface ReadableArchiveentryName - entry name
java.io.IOExceptionpublic long getEntrySize(java.lang.String name)
getEntrySize in interface ReadableArchivename - the entry name
public void open(java.net.URI uri)
throws java.io.IOException
open in interface ReadableArchiveuri - the path to the archive
java.io.IOException
protected static java.util.jar.JarFile getJarFile(java.net.URI uri)
throws java.io.IOException
java.io.IOException
public java.util.jar.Manifest getManifest()
throws java.io.IOException
getManifest in interface Archivejava.io.IOExceptionpublic java.net.URI getURI()
getURI in interface Archivepublic boolean exists()
exists in interface ReadableArchivepublic boolean delete()
delete in interface ReadableArchivepublic boolean renameTo(java.lang.String name)
renameTo in interface ReadableArchive
public ReadableArchive getSubArchive(java.lang.String name)
throws java.io.IOException
getSubArchive in interface ReadableArchivejava.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||