org.knopflerfish.framework.bundlestorage.memory.Archive Class Reference

List of all members.


Detailed Description

JAR file handling.

Author:
Jan Stein

Philippe Laporte

Version:
Revision
1.1.1.1

Definition at line 57 of file memory/Archive.java.


Protected Attributes

HashMap content
 JAR Entry handle for file that contains current archive.

Package Functions

 Archive (InputStream is) throws IOException
 Create an Archive based on contents of an InputStream, get file object for the stream and use it.
 Archive (Archive a, String path) throws IOException
 Create a Sub-Archive based on a path to in an already existing Archive.
String getAttribute (String key)
 Get an attribute from the manifest of the archive.
byte[] getClassBytes (String classFile) throws IOException
 Get a byte array containg the contents of named file from the archive.
InputStream getInputStream (String component)
 Get an InputStream to named entry inside an Archive.
Archive getSubArchive (String path) throws IOException
 Get an Archive handle to a named Jar file within this archive.

Package Attributes

Manifest manifest
 Archives manifest.

Constructor & Destructor Documentation

org.knopflerfish.framework.bundlestorage.memory.Archive.Archive ( InputStream  is  )  throws IOException [package]

Create an Archive based on contents of an InputStream, get file object for the stream and use it.

Native code is not allowed.

Parameters:
is Jar file data in an InputStream.

Definition at line 79 of file memory/Archive.java.

References org.knopflerfish.framework.bundlestorage.memory.Archive.content, and org.knopflerfish.framework.bundlestorage.memory.Archive.manifest.

Referenced by org.knopflerfish.framework.bundlestorage.memory.Archive.getSubArchive().

org.knopflerfish.framework.bundlestorage.memory.Archive.Archive ( Archive  a,
String  path 
) throws IOException [package]

Create a Sub-Archive based on a path to in an already existing Archive.

The new archive is saved in a subdirectory below local copy of the existing Archive.

Parameters:
a Parent Archive.
path Path of new Archive inside old Archive.
Exceptions:
FileNotFoundException if no such Jar file in archive.
IOException if failed to read Jar file.

Definition at line 102 of file memory/Archive.java.

References org.knopflerfish.framework.bundlestorage.memory.Archive.content.


Member Function Documentation

String org.knopflerfish.framework.bundlestorage.memory.Archive.getAttribute ( String  key  )  [package]

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.

Definition at line 119 of file memory/Archive.java.

References org.knopflerfish.framework.bundlestorage.memory.Archive.manifest.

Referenced by org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.getAttribute().

byte [] org.knopflerfish.framework.bundlestorage.memory.Archive.getClassBytes ( String  classFile  )  throws IOException [package]

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.
Exceptions:
IOException if failed to read jar entry.

Definition at line 132 of file memory/Archive.java.

References org.knopflerfish.framework.bundlestorage.memory.Archive.content.

Referenced by org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.getClassBytes().

InputStream org.knopflerfish.framework.bundlestorage.memory.Archive.getInputStream ( String  component  )  [package]

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.

Definition at line 162 of file memory/Archive.java.

References org.knopflerfish.framework.bundlestorage.memory.Archive.content.

Referenced by org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.componentExists(), org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.getInputStream(), and org.knopflerfish.framework.bundlestorage.memory.BundleArchiveImpl.getLocalizationEntries().

Archive org.knopflerfish.framework.bundlestorage.memory.Archive.getSubArchive ( String  path  )  throws IOException [package]

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.
Exceptions:
FileNotFoundException if no such Jar file in archive.
IOException if failed to read Jar file.

Definition at line 223 of file memory/Archive.java.

References org.knopflerfish.framework.bundlestorage.memory.Archive.Archive().


Member Data Documentation

HashMap org.knopflerfish.framework.bundlestorage.memory.Archive.content [protected]

JAR Entry handle for file that contains current archive.

If not null, it is a sub jar instead.

Definition at line 68 of file memory/Archive.java.

Referenced by org.knopflerfish.framework.bundlestorage.memory.Archive.Archive(), org.knopflerfish.framework.bundlestorage.memory.Archive.getClassBytes(), and org.knopflerfish.framework.bundlestorage.memory.Archive.getInputStream().


The documentation for this class was generated from the following file:
Generated on Mon Jan 11 21:19:19 2010 for OpenMobileIS by  doxygen 1.5.4