Class DeploymentPlanArchive
- java.lang.Object
-
- com.sun.enterprise.deployment.deploy.shared.JarArchive
-
- com.sun.enterprise.deployment.deploy.shared.DeploymentPlanArchive
-
- All Implemented Interfaces:
Archive
,ReadableArchive
public class DeploymentPlanArchive extends JarArchive implements ReadableArchive
This Archive offers an abstraction for jsr88 deployment plan as defined for the SJES Application Server.- Author:
- Jerome Dochez
-
-
Field Summary
-
Fields inherited from class com.sun.enterprise.deployment.deploy.shared.JarArchive
archiveMetaData, extraData, parentArchive
-
-
Constructor Summary
Constructors Constructor Description DeploymentPlanArchive()
Creates a new instance of DeploymentPlanArchive package private
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the current jar filevoid
closeEntry()
Closes the output jar file entryvoid
closeEntry(ReadableArchive sub)
Closes the output sub archive entryboolean
delete()
Deletes the underlying jar fileEnumeration
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 archiveCollection<String>
getDirectories()
Returns the enumeration of first level directories in this archiveInputStream
getEntry(String name)
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 knownJarEntry
getJarEntry(String name)
Manifest
getManifest()
Returns the manifest information for this archiveReadableArchive
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 archivevoid
open(URI uri)
Open an existing DeploymentPlan archive and return a abstraction for reading from it.boolean
renameTo(String name)
rename the underlying archive-
Methods inherited from class com.sun.enterprise.deployment.deploy.shared.JarArchive
addArchiveMetaData, entries, getArchiveMetaData, getExtraData, getName, getParentArchive, isDirectory, removeArchiveMetaData, 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.Archive
entries, getName, isDirectory
-
Methods inherited from interface org.glassfish.api.deployment.archive.ReadableArchive
addArchiveMetaData, getArchiveMetaData, getExtraData, getParentArchive, removeArchiveMetaData, removeExtraData, setExtraData, setParentArchive
-
-
-
-
Method Detail
-
open
public void open(URI uri) throws IOException
Open an existing DeploymentPlan archive and return a abstraction for reading from it.- Specified by:
open
in interfaceReadableArchive
- Parameters:
uri
- the path to the archive- Throws:
IOException
-
getArchiveSize
public long getArchiveSize() throws NullPointerException, SecurityException
Get the size of the archive- Specified by:
getArchiveSize
in interfaceArchive
- Returns:
- tje the size of this archive or -1 on error
- Throws:
NullPointerException
SecurityException
-
close
public void close() throws IOException
Closes the current jar file- Specified by:
close
in interfaceArchive
- Throws:
IOException
-
closeEntry
public void closeEntry() throws IOException
Closes the output jar file entry- Throws:
IOException
-
closeEntry
public void closeEntry(ReadableArchive sub) throws IOException
Closes the output sub archive entry- Throws:
IOException
-
delete
public boolean delete()
Deletes the underlying jar file- Specified by:
delete
in interfaceReadableArchive
-
getJarEntry
public JarEntry getJarEntry(String name)
- Specified by:
getJarEntry
in classJarArchive
-
getDirectories
public Collection<String> getDirectories() throws IOException
Description copied from interface:Archive
Returns the enumeration of first level directories in this archive- Specified by:
getDirectories
in interfaceArchive
- Returns:
- enumeration of directories under the root of this archive
- Throws:
IOException
-
entries
public Enumeration entries()
Description copied from interface:Archive
Returns an enumeration of the module file entries. All elements in the enumeration are of type String. Each String represents a file name relative to the root of the module.
-
entries
public Enumeration entries(Enumeration embeddedArchives)
- Returns:
- an Enumeration of entries not including entries from the subarchives
-
exists
public boolean exists()
- Specified by:
exists
in interfaceReadableArchive
- Returns:
- true if the underlying archive exists
-
getSubArchive
public ReadableArchive getSubArchive(String name) throws IOException
Description copied from interface:ReadableArchive
Returns an instance of this archive abstraction for an embedded archive within this archive.- Specified by:
getSubArchive
in interfaceReadableArchive
- Parameters:
name
- is the entry name relative to the root for the archive- Returns:
- a sub archive giving the name
- Throws:
IOException
-
exists
public boolean exists(String name) throws IOException
Returns the existence of the given entry name The file name must be relative to the root of the module.- Specified by:
exists
in interfaceReadableArchive
- Overrides:
exists
in classJarArchive
- Parameters:
name
- the file name relative to the root of the module. * @return the existence the given entry name.- Returns:
- the existence the given entry name.
- Throws:
IOException
-
getEntry
public InputStream getEntry(String name) throws IOException
Description copied from interface:ReadableArchive
Returns the InputStream for the given entry name The file name must be relative to the root of the module.- Specified by:
getEntry
in interfaceReadableArchive
- Parameters:
name
- the file name relative to the root of the module.- Returns:
- an input stream giving its entry name
- Throws:
IOException
-
getEntrySize
public long getEntrySize(String name)
Returns the entry size for a given entry name or 0 if not known- Specified by:
getEntrySize
in interfaceReadableArchive
- Parameters:
name
- the entry name- Returns:
- the entry size
-
getManifest
public Manifest getManifest() throws IOException
Description copied from interface:Archive
Returns the manifest information for this archive- Specified by:
getManifest
in interfaceArchive
- Returns:
- the manifest
- Throws:
IOException
-
getURI
public URI getURI()
Returns the path used to create or open the underlying archive
-
renameTo
public boolean renameTo(String name)
rename the underlying archive- Specified by:
renameTo
in interfaceReadableArchive
- Parameters:
name
- the archive name
-
-