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

List of all members.


Detailed Description

JAR file handling.

Author:
Jan Stein

Philippe Laporte

Mats-Ola Persson

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


Public Member Functions

String toString ()
 Show file name for archive, if zip show if it is sub archive.

Package Functions

 Archive (File dir, int rev, InputStream is) throws IOException
 Create an Archive based on contents of an InputStream, the archive is saved as local copy in the specified directory.
boolean isSkipped (String pathName)
 Return true if the specified path name should be skipped when unpacking.
 Archive (File dir, int rev, String location) throws IOException
 Create an Archive based on contents of a saved archive in the specified directory.
 Archive (Archive a, String path) throws IOException
 Create a Sub-Archive based on a path to in an already existing Archive.
int getRevision ()
 Get revision number this 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 class file from the archive.
InputFlow getInputFlow (String component)
 Get an InputFlow to named entry inside an Archive.
Archive getSubArchive (String path) throws IOException
 Get an Archive handle to a named Jar file within this archive.
String getNativeLibrary (String path) throws IOException
 Extract native library from JAR.
void purge ()
 Remove archive and any unpacked sub-archives.
void close ()
 Close archive and all open sub-archives.
String getPath ()
 Returns the path to this bundle.

Package Attributes

boolean bReference = new Boolean(System.getProperty("org.knopflerfish.framework.bundlestorage.file.reference", "false")).booleanValue()
 Controls if file: URLs should be referenced only, not copied to bundle storage dir.
Manifest manifest
 Archive's manifest.

Classes

class  InputFlow
 InputFlow represents an InputStream with a known length. More...

Constructor & Destructor Documentation

org.knopflerfish.framework.bundlestorage.file.Archive.Archive ( File  dir,
int  rev,
InputStream  is 
) throws IOException [package]

Create an Archive based on contents of an InputStream, the archive is saved as local copy in the specified directory.

Parameters:
dir Directory to save data in.
rev Revision of bundle content (used for updates).
is Jar file data in an InputStream.
url URL to use to CodeSource.

Definition at line 122 of file file/Archive.java.

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

org.knopflerfish.framework.bundlestorage.file.Archive.Archive ( File  dir,
int  rev,
String  location 
) throws IOException [package]

Create an Archive based on contents of a saved archive in the specified directory.

Take lowest versioned archive and remove rest.

Definition at line 236 of file file/Archive.java.

References org.knopflerfish.framework.bundlestorage.file.Archive.bReference, and org.knopflerfish.framework.bundlestorage.file.Archive.manifest.

org.knopflerfish.framework.bundlestorage.file.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 310 of file file/Archive.java.


Member Function Documentation

String org.knopflerfish.framework.bundlestorage.file.Archive.toString (  ) 

Show file name for archive, if zip show if it is sub archive.

Returns:
A string with result.

Definition at line 338 of file file/Archive.java.

int org.knopflerfish.framework.bundlestorage.file.Archive.getRevision (  )  [package]

Get revision number this archive.

Returns:
Archive revision number

Definition at line 352 of file file/Archive.java.

String org.knopflerfish.framework.bundlestorage.file.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 368 of file file/Archive.java.

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

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

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

Get a byte array containg the contents of named class file from the archive.

Parameters:
Class File to get.
Returns:
Byte array with contents of class file or null if file doesn't exist.
Exceptions:
IOException if failed to read jar entry.

Definition at line 385 of file file/Archive.java.

References org.knopflerfish.framework.bundlestorage.file.Archive.getInputFlow(), org.knopflerfish.framework.bundlestorage.file.Archive.InputFlow.is, and org.knopflerfish.framework.bundlestorage.file.Archive.InputFlow.length.

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

InputFlow org.knopflerfish.framework.bundlestorage.file.Archive.getInputFlow ( String  component  )  [package]

Get an InputFlow to named entry inside an Archive.

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

Definition at line 427 of file file/Archive.java.

Referenced by org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl.componentExists(), org.knopflerfish.framework.bundlestorage.file.Archive.getClassBytes(), org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl.getInputStream(), and org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl.getLocalizationEntries().

Archive org.knopflerfish.framework.bundlestorage.file.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 535 of file file/Archive.java.

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

String org.knopflerfish.framework.bundlestorage.file.Archive.getNativeLibrary ( String  path  )  throws IOException [package]

Extract native library from JAR.

Parameters:
key Name of Jar file to get.
Returns:
A string with path to native library.

Definition at line 549 of file file/Archive.java.

void org.knopflerfish.framework.bundlestorage.file.Archive.close (  )  [package]

Close archive and all open sub-archives.

If close fails it is silently ignored.

Definition at line 611 of file file/Archive.java.

Referenced by org.knopflerfish.framework.bundlestorage.file.Archive.purge().


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