Class ReadableArchiveAdapter
java.lang.Object
org.glassfish.api.deployment.archive.ReadableArchiveAdapter
- All Implemented Interfaces:
AutoCloseable
,Archive
,ReadableArchive
A lot of methods need to be written in order to implement ReadableArchive. The no-op methods are
implemented here to make ScatteredWar easier to understand.
- Author:
- Byron Nevins
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addArchiveMetaData
(String metaDataKey, Object metaData) void
close()
closes this archive and releases all resourcesboolean
delete()
deletes the archiveentries()
Returns an enumeration of the module file entries.Returns an enumeration of the module file entries with the specified prefix.boolean
exists()
<T> T
getArchiveMetaData
(String metaDataKey, Class<T> metadataType) long
Returns the size of the archive.Returns the enumeration of first level directories in this archivelong
getEntrySize
(String arg0) Returns the entry size for a given entry name or 0 if not known<U> U
getExtraData
(Class<U> dataType) Returns any data that could have been calculated as part of the descriptor loading.get the parent archive of this archivegetSubArchive
(String arg0) Returns an instance of this archive abstraction for an embedded archive within this archive.boolean
isDirectory
(String name) Returns true if the entry is a directory or a plain filevoid
Open an abstract archivevoid
removeArchiveMetaData
(String metaDataKey) <U> void
removeExtraData
(Class<U> dataType) boolean
rename the archive<U> void
setExtraData
(Class<U> dataType, U instance) void
setParentArchive
(ReadableArchive parentArchive) set the parent archive for this archiveMethods 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
getManifest, getName, getURI
Methods inherited from interface org.glassfish.api.deployment.archive.ReadableArchive
exists, getEntry
-
Constructor Details
-
ReadableArchiveAdapter
public ReadableArchiveAdapter()
-
-
Method Details
-
getEntrySize
Description copied from interface:ReadableArchive
Returns the entry size for a given entry name or 0 if not known- Specified by:
getEntrySize
in interfaceReadableArchive
- Parameters:
arg0
- the entry name- Returns:
- the entry size
-
open
Description copied from interface:ReadableArchive
Open an abstract archive- Specified by:
open
in interfaceReadableArchive
- Parameters:
arg0
- path to the archive- Throws:
IOException
-
getSubArchive
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:
arg0
- is the entry name relative to the root for the archive- Returns:
- the Archive instance for this abstraction, or null if no such entry exists.
- Throws:
IOException
-
delete
public boolean delete()Description copied from interface:ReadableArchive
deletes the archive- Specified by:
delete
in interfaceReadableArchive
-
renameTo
Description copied from interface:ReadableArchive
rename the archive- Specified by:
renameTo
in interfaceReadableArchive
- Parameters:
arg0
- the archive name
-
close
Description copied from interface:Archive
closes this archive and releases all resources- Specified by:
close
in interfaceArchive
- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
-
getArchiveSize
Description copied from interface:Archive
Returns the size of the archive.- Specified by:
getArchiveSize
in interfaceArchive
- Returns:
- long indicating the size of the archive
- Throws:
SecurityException
-
exists
public boolean exists()- Specified by:
exists
in interfaceReadableArchive
- Returns:
- true if this archive exists
-
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
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. -
getDirectories
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
-
isDirectory
Description copied from interface:Archive
Returns true if the entry is a directory or a plain file- Specified by:
isDirectory
in interfaceArchive
- Parameters:
name
- name is one of the entries returned byArchive.entries()
- Returns:
- true if the entry denoted by the passed name is a directory
-
setParentArchive
Description copied from interface:ReadableArchive
set the parent archive for this archive- Specified by:
setParentArchive
in interfaceReadableArchive
- Parameters:
parentArchive
- the parent archive
-
getParentArchive
Description copied from interface:ReadableArchive
get the parent archive of this archive- Specified by:
getParentArchive
in interfaceReadableArchive
- Returns:
- the parent archive
-
getExtraData
Description copied from interface:ReadableArchive
Returns any data that could have been calculated as part of the descriptor loading.- Specified by:
getExtraData
in interfaceReadableArchive
- Parameters:
dataType
- the type of the extra data- Returns:
- the extra data or null if there are not an instance of type dataType registered.
-
setExtraData
- Specified by:
setExtraData
in interfaceReadableArchive
-
removeExtraData
- Specified by:
removeExtraData
in interfaceReadableArchive
-
addArchiveMetaData
- Specified by:
addArchiveMetaData
in interfaceReadableArchive
-
getArchiveMetaData
- Specified by:
getArchiveMetaData
in interfaceReadableArchive
-
removeArchiveMetaData
- Specified by:
removeArchiveMetaData
in interfaceReadableArchive
-