|
||||||||||
| 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 JarFile |
jarFile
|
protected JarInputStream |
jarIS
|
| Fields inherited from class com.sun.enterprise.deployment.deploy.shared.JarArchive |
|---|
extraData |
| Constructor Summary | |
|---|---|
InputJarArchive()
|
|
| Method Summary | |
|---|---|
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()
|
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 |
| 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 JarFile jarFile
protected volatile JarInputStream jarIS
| Constructor Detail |
|---|
public InputJarArchive()
| Method Detail |
|---|
public long getArchiveSize()
throws NullPointerException,
SecurityException
getArchiveSize in interface ArchiveNullPointerException
SecurityException
public OutputStream addEntry(String name)
throws IOException
name - the entry name
IOException
public void close()
throws IOException
close in interface ArchiveIOException
public 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 ArchiveIOException
public void create(URI uri)
throws IOException
uri - the path to create the archive
IOExceptionpublic Enumeration<String> entries()
entries in interface Archivepublic Enumeration entries(Enumeration embeddedArchives)
public JarEntry getJarEntry(String name)
getJarEntry in class JarArchive
public 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.
IOException
public InputStream getEntry(String entryName)
throws IOException
getEntry in interface ReadableArchiveentryName - entry name
IOExceptionpublic long getEntrySize(String name)
getEntrySize in interface ReadableArchivename - the entry name
public void open(URI uri)
throws IOException
open in interface ReadableArchiveuri - the path to the archive
IOException
protected static JarFile getJarFile(URI uri)
throws IOException
IOException
public Manifest getManifest()
throws IOException
getManifest in interface ArchiveIOExceptionpublic URI getURI()
getURI in interface Archivepublic boolean exists()
exists in interface ReadableArchivepublic boolean delete()
delete in interface ReadableArchivepublic boolean renameTo(String name)
renameTo in interface ReadableArchive
public ReadableArchive getSubArchive(String name)
throws IOException
getSubArchive in interface ReadableArchiveIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||