Interface Archive
-
- All Known Subinterfaces:
ReadableArchive
,WritableArchive
- All Known Implementing Classes:
AbstractReadableArchive
,CompositeArchive
,ConfigBeanArchive
,DeploymentPlanArchive
,FileArchive
,HTTPInputArchive
,HTTPSInputArchive
,InputJarArchive
,JarArchive
,MemoryMappedArchive
,MultiReadableArchive
,OutputJarArchive
,ReadableArchiveAdapter
,ScatteredArchive
public interface Archive
This interface is an abstraction for accessing a module archive.- Author:
- Jerome Dochez
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
closes this archive and releases all resourcesEnumeration<String>
entries()
Returns an enumeration of the module file entries.Enumeration<String>
entries(String prefix)
Returns an enumeration of the module file entries with the specified prefix.long
getArchiveSize()
Returns the size of the archive.Collection<String>
getDirectories()
Returns the enumeration of first level directories in this archiveManifest
getManifest()
Returns the manifest information for this archiveString
getName()
Returns the name of the archive.URI
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 Detail
-
close
void close() throws IOException
closes this archive and releases all resources- 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
Enumeration<String> entries(String prefix)
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
Collection<String> getDirectories() throws IOException
Returns the enumeration of first level directories in this archive- Returns:
- enumeration of directories under the root of this archive
- Throws:
IOException
-
isDirectory
boolean isDirectory(String name)
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
Manifest getManifest() throws IOException
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
long getArchiveSize() throws SecurityException
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
-
-