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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddArchiveMetaData(String metaDataKey, Object metaData) voidclose()closes this archive and releases all resourcesbooleandelete()deletes the archiveentries()Returns an enumeration of the module file entries.Returns an enumeration of the module file entries with the specified prefix.booleanexists()<T> TgetArchiveMetaData(String metaDataKey, Class<T> metadataType) longReturns the size of the archive.Returns the enumeration of first level directories in this archivelonggetEntrySize(String arg0) Returns the entry size for a given entry name or 0 if not known<U> UgetExtraData(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.booleanisDirectory(String name) Returns true if the entry is a directory or a plain filevoidOpen an abstract archivevoidremoveArchiveMetaData(String metaDataKey) <U> voidremoveExtraData(Class<U> dataType) booleanrename the archive<U> voidsetExtraData(Class<U> dataType, U instance) voidsetParentArchive(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, waitMethods inherited from interface org.glassfish.api.deployment.archive.Archive
getManifest, getName, getURIMethods inherited from interface org.glassfish.api.deployment.archive.ReadableArchive
exists, getEntry
-
Constructor Details
-
ReadableArchiveAdapter
public ReadableArchiveAdapter()
-
-
Method Details
-
getEntrySize
Description copied from interface:ReadableArchiveReturns the entry size for a given entry name or 0 if not known- Specified by:
getEntrySizein interfaceReadableArchive- Parameters:
arg0- the entry name- Returns:
- the entry size
-
open
Description copied from interface:ReadableArchiveOpen an abstract archive- Specified by:
openin interfaceReadableArchive- Parameters:
arg0- path to the archive- Throws:
IOException
-
getSubArchive
Description copied from interface:ReadableArchiveReturns an instance of this archive abstraction for an embedded archive within this archive.- Specified by:
getSubArchivein 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:ReadableArchivedeletes the archive- Specified by:
deletein interfaceReadableArchive
-
renameTo
Description copied from interface:ReadableArchiverename the archive- Specified by:
renameToin interfaceReadableArchive- Parameters:
arg0- the archive name
-
close
Description copied from interface:Archivecloses this archive and releases all resources- Specified by:
closein interfaceArchive- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
getArchiveSize
Description copied from interface:ArchiveReturns the size of the archive.- Specified by:
getArchiveSizein interfaceArchive- Returns:
- long indicating the size of the archive
- Throws:
SecurityException
-
exists
public boolean exists()- Specified by:
existsin interfaceReadableArchive- Returns:
- true if this archive exists
-
entries
Description copied from interface:ArchiveReturns 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:ArchiveReturns 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:ArchiveReturns the enumeration of first level directories in this archive- Specified by:
getDirectoriesin interfaceArchive- Returns:
- enumeration of directories under the root of this archive
- Throws:
IOException
-
isDirectory
Description copied from interface:ArchiveReturns true if the entry is a directory or a plain file- Specified by:
isDirectoryin 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:ReadableArchiveset the parent archive for this archive- Specified by:
setParentArchivein interfaceReadableArchive- Parameters:
parentArchive- the parent archive
-
getParentArchive
Description copied from interface:ReadableArchiveget the parent archive of this archive- Specified by:
getParentArchivein interfaceReadableArchive- Returns:
- the parent archive
-
getExtraData
Description copied from interface:ReadableArchiveReturns any data that could have been calculated as part of the descriptor loading.- Specified by:
getExtraDatain 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:
setExtraDatain interfaceReadableArchive
-
removeExtraData
- Specified by:
removeExtraDatain interfaceReadableArchive
-
addArchiveMetaData
- Specified by:
addArchiveMetaDatain interfaceReadableArchive
-
getArchiveMetaData
- Specified by:
getArchiveMetaDatain interfaceReadableArchive
-
removeArchiveMetaData
- Specified by:
removeArchiveMetaDatain interfaceReadableArchive
-