Class JarArchive
java.lang.Object
com.sun.enterprise.deployment.deploy.shared.JarArchive
- All Implemented Interfaces:
AutoCloseable,org.glassfish.api.deployment.archive.Archive
- Direct Known Subclasses:
DeploymentPlanArchive,InputJarArchive,MemoryMappedArchive,OutputJarArchive
public abstract class JarArchive
extends Object
implements org.glassfish.api.deployment.archive.Archive
This abstract class contains all common implementation of the Archive/WritableArchive interfaces for Jar files
- Author:
- Jerome Dochez
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.glassfish.api.deployment.archive.ReadableArchive -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddArchiveMetaData(String metaDataKey, Object metaData) Returns an enumeration of the module file entries with the specified prefix.booleanReturns the existence of the given entry name The file name must be relative to the root of the module.<T> TgetArchiveMetaData(String metaDataKey, Class<T> metadataType) <U> UgetExtraData(Class<U> dataType) Returns any data that could have been calculated as part of the descriptor loading.protected abstract JarEntrygetJarEntry(String entryName) getName()Returns the name portion of the archive's URI.org.glassfish.api.deployment.archive.ReadableArchiveget the parent archive of this archivebooleanisDirectory(String name) Returns true if the entry is a directory or a plain filevoidremoveArchiveMetaData(String metaDataKey) <U> voidremoveExtraData(Class<U> dataType) <U> voidsetExtraData(Class<U> dataType, U instance) voidsetParentArchive(org.glassfish.api.deployment.archive.ReadableArchive parentArchive) set the parent archive for this archivetoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.glassfish.api.deployment.archive.Archive
close, entries, getArchiveSize, getDirectories, getManifest, getURI
-
Field Details
-
parentArchive
protected org.glassfish.api.deployment.archive.ReadableArchive parentArchive -
extraData
-
archiveMetaData
-
-
Constructor Details
-
JarArchive
public JarArchive()
-
-
Method Details
-
entries
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.- Specified by:
entriesin interfaceorg.glassfish.api.deployment.archive.Archive- Parameters:
prefix- the prefix of entries to be included- Returns:
- an enumeration of the archive file entries.
-
getName
Returns the name portion of the archive's URI.For JarArhive the name is all of the path that follows the last slash up to but not including the last dot.
Here are some example archive names for the specified JarArchive paths:
- /a/b/c/d.jar -> d
- /a/b/c/d -> d
- /x/y/z.html -> z
- Specified by:
getNamein interfaceorg.glassfish.api.deployment.archive.Archive- Returns:
- the name of the archive
-
getJarEntry
-
exists
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. * @return the existence the given entry name.- Throws:
IOException
-
isDirectory
Returns true if the entry is a directory or a plain file- Specified by:
isDirectoryin interfaceorg.glassfish.api.deployment.archive.Archive- 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
public void setParentArchive(org.glassfish.api.deployment.archive.ReadableArchive parentArchive) set the parent archive for this archive- Parameters:
parentArchive- the parent archive
-
getParentArchive
public org.glassfish.api.deployment.archive.ReadableArchive getParentArchive()get the parent archive of this archive- Returns:
- the parent archive
-
getExtraData
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
-
removeExtraData
-
addArchiveMetaData
-
getArchiveMetaData
-
removeArchiveMetaData
-
toString
-