Interface ReadableArchive
-
- All Superinterfaces:
Archive
- All Known Implementing Classes:
AbstractReadableArchive
,CompositeArchive
,ConfigBeanArchive
,DeploymentPlanArchive
,FileArchive
,HTTPInputArchive
,HTTPSInputArchive
,InputJarArchive
,MemoryMappedArchive
,MultiReadableArchive
,ReadableArchiveAdapter
,ScatteredArchive
@Contract public interface ReadableArchive extends Archive
Interface for implementing read access to an underlying archive on a unspecified medium- Author:
- Jerome Dochez
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addArchiveMetaData(String metaDataKey, Object metaData)
boolean
delete()
deletes the archiveboolean
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.<T> T
getArchiveMetaData(String metaDataKey, Class<T> metadataType)
InputStream
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 known<U> U
getExtraData(Class<U> dataType)
Returns any data that could have been calculated as part of the descriptor loading.ReadableArchive
getParentArchive()
get the parent archive of this archiveReadableArchive
getSubArchive(String name)
Returns an instance of this archive abstraction for an embedded archive within this archive.void
open(URI uri)
Open an abstract archivevoid
removeArchiveMetaData(String metaDataKey)
<U> void
removeExtraData(Class<U> dataType)
boolean
renameTo(String name)
rename the archive<U> void
setExtraData(Class<U> dataType, U instance)
void
setParentArchive(ReadableArchive parentArchive)
set the parent archive for this archive-
Methods inherited from interface org.glassfish.api.deployment.archive.Archive
close, entries, entries, getArchiveSize, getDirectories, getManifest, getName, getURI, isDirectory
-
-
-
-
Method Detail
-
getEntry
InputStream getEntry(String name) throws IOException
Returns the InputStream for 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 InputStream for the given entry name or null if not found.
- Throws:
IOException
-
exists
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.- Parameters:
name
- the file name relative to the root of the module.- Returns:
- the existence the given entry name.
- Throws:
IOException
-
getEntrySize
long getEntrySize(String name)
Returns the entry size for a given entry name or 0 if not known- Parameters:
name
- the entry name- Returns:
- the entry size
-
open
void open(URI uri) throws IOException
Open an abstract archive- Parameters:
uri
- path to the archive- Throws:
IOException
-
getSubArchive
ReadableArchive getSubArchive(String name) throws IOException
Returns an instance of this archive abstraction for an embedded archive within this archive.- Parameters:
name
- 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
-
exists
boolean exists()
- Returns:
- true if this archive exists
-
delete
boolean delete()
deletes the archive
-
renameTo
boolean renameTo(String name)
rename the archive- Parameters:
name
- the archive name
-
setParentArchive
void setParentArchive(ReadableArchive parentArchive)
set the parent archive for this archive- Parameters:
parentArchive
- the parent archive
-
getParentArchive
ReadableArchive getParentArchive()
get the parent archive of this archive- Returns:
- the parent archive
-
getExtraData
<U> U getExtraData(Class<U> dataType)
Returns any data that could have been calculated as part of the descriptor loading.- 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
<U> void setExtraData(Class<U> dataType, U instance)
-
removeExtraData
<U> void removeExtraData(Class<U> dataType)
-
removeArchiveMetaData
void removeArchiveMetaData(String metaDataKey)
-
-