Package org.glassfish.deployapi.config
Class ConfigBeanArchive
- java.lang.Object
-
- com.sun.enterprise.deploy.shared.AbstractReadableArchive
-
- org.glassfish.deployapi.config.ConfigBeanArchive
-
- All Implemented Interfaces:
Archive
,ReadableArchive
public class ConfigBeanArchive extends AbstractReadableArchive
This class act as an ReadableArchive implementation, delegating all possible APIs to the JSR88 DeployObject object.- Author:
- Jerome Dochez
-
-
Field Summary
-
Fields inherited from class com.sun.enterprise.deploy.shared.AbstractReadableArchive
archiveMetaData, extraData, parentArchive
-
-
Constructor Summary
Constructors Constructor Description ConfigBeanArchive(javax.enterprise.deploy.model.DeployableObject deployObject)
Creates a new instance of ConfigBeanArchive
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
close the abstract archivevoid
closeEntry()
void
closeEntry(OutputStream os)
close a previously returned @see java.io.OutputStream returned by an addEntry callvoid
closeEntry(ReadableArchive os)
close a previously returned @see java.io.OutputStream returned by an addEntry callboolean
delete()
delete the archiveEnumeration
entries()
Returns an enumeration of the module file entries.Enumeration<String>
entries(String prefix)
Returns an enumeration of the module file entries with the specified prefix.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()
Returns the size of the archive.String
getArchiveUri()
Collection<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 knownManifest
getManifest()
Returns the manifest information for this archiveString
getName()
Returns the name of the archive.ReadableArchive
getSubArchive(String name)
create or obtain a subarchive within this abstraction.URI
getURI()
Returns the path used to create or open the underlying archiveboolean
isDirectory(String name)
Returns true if the entry is a directory or a plain filevoid
open(URI uri)
Open an abstract archiveboolean
renameTo(String name)
rename the archiveboolean
supportsElementsOverwriting()
-
Methods inherited from class com.sun.enterprise.deploy.shared.AbstractReadableArchive
addArchiveMetaData, getArchiveMetaData, getExtraData, getParentArchive, removeArchiveMetaData, removeExtraData, setExtraData, setParentArchive
-
-
-
-
Method Detail
-
close
public void close() throws IOException
close the abstract archive- Throws:
IOException
-
closeEntry
public void closeEntry(ReadableArchive os) throws IOException
close a previously returned @see java.io.OutputStream returned by an addEntry call- Parameters:
the
- output stream to close- Throws:
IOException
-
closeEntry
public void closeEntry(OutputStream os) throws IOException
close a previously returned @see java.io.OutputStream returned by an addEntry call- Parameters:
the
- output stream to close- Throws:
IOException
-
delete
public boolean delete()
delete the archive
-
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.- Returns:
- an @see java.util.Enumeration of entries in this abstract archive
-
entries
public Enumeration<String> entries(String prefix)
Description copied from interface:Archive
Returns an enumeration of the module file entries with the specified prefix. All elements in the enumeration are of type String. Each String represents a file name relative to the root of the module.- Parameters:
prefix
- the prefix of entries to be included- Returns:
- an enumeration of the archive file entries.
-
getDirectories
public Collection<String> getDirectories() throws IOException
Description copied from interface:Archive
Returns the enumeration of first level directories in this archive- Returns:
- enumeration of directories under the root of this archive
- Throws:
IOException
-
isDirectory
public boolean isDirectory(String name)
Description copied from interface:Archive
Returns true if the entry is a directory or a plain file- Parameters:
name
- name is one of the entries returned byArchive.entries()
- Returns:
- true if the entry denoted by the passed name is a directory
-
getName
public String getName()
Description copied from interface:Archive
Returns the name of the archive.Implementations should not return null.
- Returns:
- the name of the archive
-
exists
public boolean exists()
- Returns:
- true if this archive exists
-
exists
public boolean exists(String name) throws IOException
Description copied from interface:ReadableArchive
Returns the existence of the given entry name The file name must be relative to the root of the module.- Parameters:
name
- the file name relative to the root of the module.- Returns:
- the existence the given entry name.
- Throws:
IOException
-
getArchiveUri
public String getArchiveUri()
- Returns:
- the archive uri
-
getEntrySize
public long getEntrySize(String name)
Description copied from interface:ReadableArchive
Returns the entry size for a given entry name or 0 if not known- Parameters:
name
- the entry name- Returns:
- the entry size
-
open
public void open(URI uri) throws IOException
Description copied from interface:ReadableArchive
Open an abstract archive- Parameters:
uri
- path to the archive- Throws:
IOException
-
getArchiveSize
public long getArchiveSize() throws NullPointerException, SecurityException
Description copied from interface:Archive
Returns the size of the archive.- Returns:
- the archive size
- Throws:
NullPointerException
SecurityException
-
getSubArchive
public ReadableArchive getSubArchive(String name) throws IOException
create or obtain a subarchive within this abstraction.- Parameters:
the
- name of the subarchive.- Returns:
- the Archive instance for this abstraction, or null if no such entry exists.
- 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.- Parameters:
the
- entry name- Returns:
- a @see java.io.InputStream for an existing entry in the current abstract archive
- Throws:
IOException
-
getManifest
public Manifest getManifest() throws IOException
Description copied from interface:Archive
Returns the manifest information for this archive- Returns:
- the manifest information for this abstract archive
- Throws:
IOException
-
renameTo
public boolean renameTo(String name)
rename the archive- Parameters:
name
- the archive name
-
supportsElementsOverwriting
public boolean supportsElementsOverwriting()
- Returns:
- true if this archive abstraction supports overwriting of elements
-
closeEntry
public void closeEntry() throws IOException
- Throws:
IOException
-
getURI
public URI getURI()
Description copied from interface:Archive
Returns the path used to create or open the underlying archiveTODO: abstraction breakage: Several callers, most notably
DeploymentContext.getSourceDir()
implementation, assumes that this URI is an URL, and in fact file URL.If this needs to be URL, use of
URI
is misleading. And furthermore, if its needs to be a file URL, this should beFile
.- Returns:
- the path for this archive.
-
-