Package org.glassfish.internal.embedded
Class ScatteredArchive
java.lang.Object
org.glassfish.api.deployment.archive.ReadableArchiveAdapter
org.glassfish.internal.embedded.ScatteredArchive
- All Implemented Interfaces:
AutoCloseable,org.glassfish.api.deployment.archive.Archive,org.glassfish.api.deployment.archive.ReadableArchive
public class ScatteredArchive
extends org.glassfish.api.deployment.archive.ReadableArchiveAdapter
Abstraction for a scattered archive (parts disseminated in various directories)
- Author:
- Jerome Dochez
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()entries()Returns an enumeration of the module file entries.Returns an enumeration of the module file entries with the specified prefix.booleanReturns whether or not a file by that name exists The file name must be relative to the root of the module.Get the classpath URLsReturns the InputStream for the given entry name The file name must be relative to the root of the module.longgetEntrySize(String arg) Returns the manifest information for this archivegetName()Returns the name of the archive.getURI()Returns the path used to create or open the underlying archivetoString()type()Returns the archive typeMethods inherited from class org.glassfish.api.deployment.archive.ReadableArchiveAdapter
addArchiveMetaData, delete, exists, getArchiveMetaData, getArchiveSize, getExtraData, getParentArchive, getSubArchive, isDirectory, open, removeArchiveMetaData, removeExtraData, renameTo, setExtraData, setParentArchive
-
Method Details
-
getClassPath
Get the classpath URLs- Returns:
- A read-only copy of the classpath URL Collection
-
getResourcesDir
- Returns:
- The resources directory
-
getEntry
Returns the InputStream for the given entry name The file name must be relative to the root of the module.- Parameters:
arg- 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
-
getEntrySize
-
exists
Returns whether or not a file by that name exists 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:
- does the file exist?
- Throws:
IOException
-
entries
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.Currently under construction
- Specified by:
entriesin interfaceorg.glassfish.api.deployment.archive.Archive- Overrides:
entriesin classorg.glassfish.api.deployment.archive.ReadableArchiveAdapter- Returns:
- an enumeration of the archive file entries.
-
getManifest
Returns the manifest information for this archive- Returns:
- the manifest info
- Throws:
IOException
-
getURI
Returns the path used to create or open the underlying archive TODO: abstraction breakage: Several callers, most notablyDeploymentContext.getSourceDir()implementation, assumes that this URI is an URL, and in fact file URL. If this needs to be URL, use ofURIis misleading. And furthermore, if its needs to be a file URL, this should beFile.- Returns:
- the path for this archive.
-
getName
Returns the name of the archive. Implementations should not return null.- Returns:
- the name of the archive
-
type
Returns the archive type- Returns:
- the archive type
-
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.Currently Not Supported
- Specified by:
entriesin interfaceorg.glassfish.api.deployment.archive.Archive- Overrides:
entriesin classorg.glassfish.api.deployment.archive.ReadableArchiveAdapter- Parameters:
s- the prefix of entries to be included- Returns:
- an enumeration of the archive file entries.
-
getDirectories
- Specified by:
getDirectoriesin interfaceorg.glassfish.api.deployment.archive.Archive- Overrides:
getDirectoriesin classorg.glassfish.api.deployment.archive.ReadableArchiveAdapter- Throws:
IOException
-
toString
-
getFile
-
close
- Specified by:
closein interfaceorg.glassfish.api.deployment.archive.Archive- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classorg.glassfish.api.deployment.archive.ReadableArchiveAdapter- Throws:
IOException
-