Interface Archive
- All Superinterfaces:
AutoCloseable
- All Known Subinterfaces:
ReadableArchive
,WritableArchive
- All Known Implementing Classes:
ReadableArchiveAdapter
This interface is an abstraction for accessing a module archive.
- Author:
- Jerome Dochez
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
closes this archive and releases all resourcesentries()
Returns an enumeration of the module file entries.Returns an enumeration of the module file entries with the specified prefix.long
Returns the size of the archive.Returns the enumeration of first level directories in this archiveReturns the manifest information for this archivegetName()
Returns the name of the archive.getURI()
Returns the path used to create or open the underlying archiveboolean
isDirectory
(String name) Returns true if the entry is a directory or a plain file
-
Method Details
-
close
closes this archive and releases all resources- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
-
entries
Enumeration<String> 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.- Returns:
- an enumeration of the archive file entries.
-
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.- Parameters:
prefix
- the prefix of entries to be included- Returns:
- an enumeration of the archive file entries.
-
getDirectories
Returns the enumeration of first level directories in this archive- Returns:
- enumeration of directories under the root of this archive
- Throws:
IOException
-
isDirectory
Returns true if the entry is a directory or a plain file- Parameters:
name
- name is one of the entries returned byentries()
- Returns:
- true if the entry denoted by the passed name is a directory
-
getManifest
Returns the manifest information for this archive- Returns:
- the manifest info
- Throws:
IOException
-
getURI
URI getURI()Returns the path used to create or open the underlying archiveTODO: abstraction breakage: Several callers, most notably
DeploymentContext.getSourceDir()
implementation, assumes that this URI is an URL, and in fact file URL.If this needs to be URL, use of
URI
is misleading. And furthermore, if its needs to be a file URL, this should beFile
.- Returns:
- the path for this archive.
-
getArchiveSize
Returns the size of the archive.- Returns:
- long indicating the size of the archive
- Throws:
SecurityException
-
getName
String getName()Returns the name of the archive.Implementations should not return null.
- Returns:
- the name of the archive
-