Class MemoryMappedArchive
java.lang.Object
com.sun.enterprise.deployment.deploy.shared.JarArchive
com.sun.enterprise.deployment.deploy.shared.MemoryMappedArchive
- All Implemented Interfaces:
AutoCloseable,org.glassfish.api.deployment.archive.Archive,org.glassfish.api.deployment.archive.ReadableArchive
@Service
@PerLookup
public class MemoryMappedArchive
extends JarArchive
implements org.glassfish.api.deployment.archive.ReadableArchive
- Author:
- Jerome Dochez
-
Field Summary
Fields inherited from class com.sun.enterprise.deployment.deploy.shared.JarArchive
archiveMetaData, extraData, parentArchive -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a new instance of MemoryMappedArchiveMemoryMappedArchive(byte[] bits) Creates a new instance of MemoryMappedArchiveMemoryMappedArchive(org.glassfish.api.deployment.archive.ReadableArchive source) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()close the abstract archivebooleandelete()delete the archiveentries()entries(Enumeration embeddedArchives) booleanexists()booleanReturns the existence of the given entry name The file name must be relative to the root of the module.longGet the size of the archivebyte[]longgetEntrySize(String name) Returns the entry size for a given entry name or 0 if not knowngetJarEntry(String name) getName()Returns the name for the archive.getPath()org.glassfish.api.deployment.archive.ReadableArchivegetSubArchive(String name) create or obtain an embedded archive within this abstraction.getURI()voidbooleanrename the archivevoidMethods inherited from class com.sun.enterprise.deployment.deploy.shared.JarArchive
addArchiveMetaData, entries, getArchiveMetaData, getExtraData, getParentArchive, isDirectory, removeArchiveMetaData, removeExtraData, setExtraData, setParentArchiveMethods 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
entries, isDirectoryMethods inherited from interface org.glassfish.api.deployment.archive.ReadableArchive
addArchiveMetaData, getArchiveMetaData, getExtraData, getParentArchive, removeArchiveMetaData, removeExtraData, setExtraData, setParentArchive
-
Constructor Details
-
MemoryMappedArchive
protected MemoryMappedArchive()Creates a new instance of MemoryMappedArchive -
MemoryMappedArchive
Creates a new instance of MemoryMappedArchive- Throws:
IOException
-
MemoryMappedArchive
public MemoryMappedArchive(byte[] bits) -
MemoryMappedArchive
public MemoryMappedArchive(org.glassfish.api.deployment.archive.ReadableArchive source) throws IOException - Throws:
IOException
-
-
Method Details
-
getByteArray
public byte[] getByteArray() -
open
- Specified by:
openin interfaceorg.glassfish.api.deployment.archive.ReadableArchive- Throws:
IOException
-
close
close the abstract archive- Specified by:
closein interfaceorg.glassfish.api.deployment.archive.Archive- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
delete
public boolean delete()delete the archive- Specified by:
deletein interfaceorg.glassfish.api.deployment.archive.ReadableArchive
-
entries
- Specified by:
entriesin interfaceorg.glassfish.api.deployment.archive.Archive- Returns:
- an @see java.util.Enumeration of entries in this abstract archive
-
getDirectories
- Specified by:
getDirectoriesin interfaceorg.glassfish.api.deployment.archive.Archive- Throws:
IOException
-
entries
- Returns:
- an @see java.util.Enumeration of entries in this abstract archive, providing the list of embedded archive to not count their entries as part of this archive
-
exists
public boolean exists()- Specified by:
existsin interfaceorg.glassfish.api.deployment.archive.ReadableArchive- Returns:
- true if this archive exists
-
getPath
- Returns:
- the archive uri
-
getArchiveSize
Get the size of the archive- Specified by:
getArchiveSizein interfaceorg.glassfish.api.deployment.archive.Archive- Returns:
- tje the size of this archive or -1 on error
- Throws:
NullPointerExceptionSecurityException
-
getURI
- Specified by:
getURIin interfaceorg.glassfish.api.deployment.archive.Archive
-
setURI
-
getSubArchive
public org.glassfish.api.deployment.archive.ReadableArchive getSubArchive(String name) throws IOException create or obtain an embedded archive within this abstraction.- Specified by:
getSubArchivein interfaceorg.glassfish.api.deployment.archive.ReadableArchive- Parameters:
name- the name of the embedded archive.- Throws:
IOException
-
exists
Returns the existence of the given entry name The file name must be relative to the root of the module.- Specified by:
existsin interfaceorg.glassfish.api.deployment.archive.ReadableArchive- Overrides:
existsin classJarArchive- Parameters:
name- the file name relative to the root of the module.- Returns:
- the existence the given entry name.
- Throws:
IOException
-
getEntry
- Specified by:
getEntryin interfaceorg.glassfish.api.deployment.archive.ReadableArchive- Parameters:
name- the entry name- Returns:
- a @see java.io.InputStream for an existing entry in the current abstract archive
- Throws:
IOException
-
getJarEntry
- Specified by:
getJarEntryin classJarArchive
-
getEntrySize
Returns the entry size for a given entry name or 0 if not known- Specified by:
getEntrySizein interfaceorg.glassfish.api.deployment.archive.ReadableArchive- Parameters:
name- the entry name- Returns:
- the entry size
-
getManifest
- Specified by:
getManifestin interfaceorg.glassfish.api.deployment.archive.Archive- Returns:
- the manifest information for this abstract archive
- Throws:
IOException
-
renameTo
rename the archive- Specified by:
renameToin interfaceorg.glassfish.api.deployment.archive.ReadableArchive- Parameters:
name- the archive name
-
getName
Returns the name for the archive.For a MemoryMappedArhive there is no name, so an empty string is returned.
- Specified by:
getNamein interfaceorg.glassfish.api.deployment.archive.Archive- Overrides:
getNamein classJarArchive- Returns:
- the name of the archive
-