Class OutputJarArchive
- java.lang.Object
-
- com.sun.enterprise.deployment.deploy.shared.JarArchive
-
- com.sun.enterprise.deployment.deploy.shared.OutputJarArchive
-
- All Implemented Interfaces:
org.glassfish.api.deployment.archive.Archive,org.glassfish.api.deployment.archive.WritableArchive
@Service(name="jar") @PerLookup public class OutputJarArchive extends JarArchive implements org.glassfish.api.deployment.archive.WritableArchive
Provides an implementation of the Archive that maps to a Jar file @see java.util.jar.JarFile- Author:
- Jerome Dochez
-
-
Field Summary
Fields Modifier and Type Field Description protected ZipOutputStreamjos-
Fields inherited from class com.sun.enterprise.deployment.deploy.shared.JarArchive
archiveMetaData, extraData, parentArchive
-
-
Constructor Summary
Constructors Constructor Description OutputJarArchive()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()close the abstract archivevoidcloseEntry()closes the current entryvoidcloseEntry(org.glassfish.api.deployment.archive.WritableArchive subArchive)Close a previously returned sub archivevoidcreate(URI path)creates a new abstract archive with the given pathorg.glassfish.api.deployment.archive.WritableArchivecreateSubArchive(String name)Enumerationentries()Enumerationentries(Enumeration embeddedArchives)longgetArchiveSize()Get the size of the archiveCollection<String>getDirectories()protected JarEntrygetJarEntry(String entryName)ManifestgetManifest()URIgetURI()Returns the path used to create or open the underlyong archiveOutputStreamputNextEntry(String name)-
Methods inherited from class com.sun.enterprise.deployment.deploy.shared.JarArchive
addArchiveMetaData, entries, exists, getArchiveMetaData, getExtraData, getName, getParentArchive, isDirectory, removeArchiveMetaData, removeExtraData, setExtraData, setParentArchive
-
-
-
-
Field Detail
-
jos
protected ZipOutputStream jos
-
-
Method Detail
-
getArchiveSize
public long getArchiveSize() throws NullPointerException, SecurityExceptionGet the size of the archive- Specified by:
getArchiveSizein interfaceorg.glassfish.api.deployment.archive.Archive- Returns:
- -1 because this is getting created
- Throws:
NullPointerExceptionSecurityException
-
close
public void close() throws IOExceptionclose the abstract archive- Specified by:
closein interfaceorg.glassfish.api.deployment.archive.Archive- Throws:
IOException
-
getJarEntry
protected JarEntry getJarEntry(String entryName)
- Specified by:
getJarEntryin classJarArchive
-
create
public void create(URI path) throws IOException
creates a new abstract archive with the given path- Specified by:
createin interfaceorg.glassfish.api.deployment.archive.WritableArchive- Parameters:
path- the path to create the archive- Throws:
IOException
-
entries
public Enumeration entries()
- Specified by:
entriesin interfaceorg.glassfish.api.deployment.archive.Archive- Returns:
- an @see java.util.Enumeration of entries in this abstract archive
-
getDirectories
public Collection<String> getDirectories() throws IOException
- Specified by:
getDirectoriesin interfaceorg.glassfish.api.deployment.archive.Archive- Throws:
IOException
-
entries
public Enumeration entries(Enumeration embeddedArchives)
- Returns:
- an @see java.util.Enumeration of entries in this abstract archive, providing the list of embedded archive to not count their entries as part of this archive
-
getManifest
public Manifest getManifest() throws IOException
- Specified by:
getManifestin interfaceorg.glassfish.api.deployment.archive.Archive- Returns:
- the manifest information for this abstract archive
- Throws:
IOException
-
getURI
public URI getURI()
Returns the path used to create or open the underlyong archive- Specified by:
getURIin interfaceorg.glassfish.api.deployment.archive.Archive- Returns:
- the path for this archive.
-
createSubArchive
public org.glassfish.api.deployment.archive.WritableArchive createSubArchive(String name) throws IOException
- Specified by:
createSubArchivein interfaceorg.glassfish.api.deployment.archive.WritableArchive- Throws:
IOException
-
closeEntry
public void closeEntry(org.glassfish.api.deployment.archive.WritableArchive subArchive) throws IOExceptionClose a previously returned sub archive- Specified by:
closeEntryin interfaceorg.glassfish.api.deployment.archive.WritableArchive- Parameters:
subArchive- output stream to close- Throws:
IOException
-
putNextEntry
public OutputStream putNextEntry(String name) throws IOException
- Specified by:
putNextEntryin interfaceorg.glassfish.api.deployment.archive.WritableArchive- Parameters:
name- the entry name- Throws:
IOException
-
closeEntry
public void closeEntry() throws IOExceptioncloses the current entry- Specified by:
closeEntryin interfaceorg.glassfish.api.deployment.archive.WritableArchive- Throws:
IOException
-
-