org.knopflerfish.framework
Interface FileArchive

All Known Implementing Classes:
Archive

public interface FileArchive


Method Summary
 java.util.Enumeration findResourcesPath(java.lang.String path)
           
 java.lang.String getAttribute(java.lang.String key)
          Get an attribute from the manifest of the archive.
 byte[] getClassBytes(java.lang.String classFile)
          Get a byte array containg the contents of named file from the archive.
 java.io.InputStream getInputStream(java.lang.String component)
          Get an InputStream to named entry inside an Archive.
 java.util.jar.Manifest getManifest()
          Get manifest for this archive.
 FileArchive getSubArchive(java.lang.String path)
          Get an Archive handle to a named Jar file within this archive.
 

Method Detail

getAttribute

java.lang.String getAttribute(java.lang.String key)
Get an attribute from the manifest of the archive.

Parameters:
key - Name of attribute to get.
Returns:
A string with result or null if the entry doesn't exists.

getClassBytes

byte[] getClassBytes(java.lang.String classFile)
                     throws java.io.IOException
Get a byte array containg the contents of named file from the archive.

Parameters:
component - File to get.
Returns:
Byte array with contents of file or null if file doesn't exist.
Throws:
java.io.IOException - if failed to read jar entry.

getInputStream

java.io.InputStream getInputStream(java.lang.String component)
Get an InputStream to named entry inside an Archive.

Parameters:
component - Entry to get reference to.
Returns:
InputStream to entry or null if it doesn't exist.

findResourcesPath

java.util.Enumeration findResourcesPath(java.lang.String path)

getSubArchive

FileArchive getSubArchive(java.lang.String path)
                          throws java.io.IOException
Get an Archive handle to a named Jar file within this archive.

Parameters:
path - Name of Jar file to get.
Returns:
An Archive object representing new archive.
Throws:
java.io.FileNotFoundException - if no such Jar file in archive.
java.io.IOException - if failed to read Jar file.

getManifest

java.util.jar.Manifest getManifest()
Get manifest for this archive.

Returns:
A Manifest object representing the manifest.