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

Inheritance diagram for org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl:

org.knopflerfish.framework.BundleArchive

List of all members.


Detailed Description

Interface for managing bundle data.

Author:
Jan Stein

Erik Wistrand

Robert Shelley

Philippe Laporte

Mats-Ola Persson

Definition at line 62 of file file/BundleArchiveImpl.java.


Public Member Functions

String getAttribute (String key)
 Get an attribute from the manifest of a bundle.
Hashtable getLocalizationEntries (String localeFile)
 returns the localization entries of this archive.
HeaderDictionary getUnlocalizedAttributes ()
 returns the raw unlocalized entries of this archive.
long getBundleId ()
 Get bundle identifier for this bundle archive.
String getBundleLocation ()
 Get bundle location for this bundle archive.
int getStartLevel ()
 Get stored bundle start level.
void setStartLevel (int level) throws IOException
 Set stored bundle start level.
byte[] getClassBytes (Integer sub, String path) throws IOException
 Get a byte array containg the contents of named file from a bundle archive.
Vector componentExists (String component, boolean onlyFirst)
 Check if named entry exist in bundles archive.
InputStream getInputStream (String component, int ix)
 Get an specific InputStream to named entry inside a bundle.
String getNativeLibrary (String libName)
 Get native library from JAR.
boolean getStartOnLaunchFlag ()
 Get state of start on launch flag.
void setStartOnLaunchFlag (boolean value) throws IOException
 Set state of start on launch flag.
void purge ()
 Remove bundle archive from persistent storage.
void close ()
 Close archive for further access.
List getFailedClassPathEntries ()
 Get a list with all classpath entries we failed to locate.
Enumeration findResourcesPath (String path)
 Returns an Enumeration of all the paths (String objects) to entries within the bundle whose longest sub-path matches the supplied path argument.
String getJarLocation ()
 
Returns:
the location of the cached bundle.


Package Functions

 BundleArchiveImpl (BundleStorageImpl bundleStorage, FileTree dir, InputStream is, String bundleLocation, long bundleId) throws Exception
 Construct new bundle archive.
 BundleArchiveImpl (BundleStorageImpl bundleStorage, FileTree dir, long bundleId) throws Exception
 Construct new bundle archive based on saved data.
 BundleArchiveImpl (BundleArchiveImpl old, InputStream is) throws Exception
 Construct new bundle archive in an existing bundle archive.

Static Package Functions

static boolean isUninstalled (File dir)
 Statically check if a directory contains info that a bundle is uninstalled.

Member Function Documentation

String org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl.getAttribute ( String  key  ) 

Get an attribute from the manifest of a bundle.

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

Implements org.knopflerfish.framework.BundleArchive.

Definition at line 217 of file file/BundleArchiveImpl.java.

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

long org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl.getBundleId (  ) 

Get bundle identifier for this bundle archive.

Returns:
Bundle identifier.

Implements org.knopflerfish.framework.BundleArchive.

Definition at line 254 of file file/BundleArchiveImpl.java.

String org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl.getBundleLocation (  ) 

Get bundle location for this bundle archive.

Returns:
Bundle location.

Implements org.knopflerfish.framework.BundleArchive.

Definition at line 264 of file file/BundleArchiveImpl.java.

byte [] org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl.getClassBytes ( Integer  sub,
String  path 
) throws IOException

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

Parameters:
sub index of jar, 0 means the top level.
path Path to class file.
Returns:
Byte array with contents of file or null if file doesn't exist.
Exceptions:
IOException if failed to read jar entry.

Implements org.knopflerfish.framework.BundleArchive.

Definition at line 315 of file file/BundleArchiveImpl.java.

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

Vector org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl.componentExists ( String  component,
boolean  onlyFirst 
)

Check if named entry exist in bundles archive.

Leading '/' is stripped.

Parameters:
component Entry to get reference to.
onlyFirst End search when we find first entry if this is true.
Returns:
Vector or entry numbers, or null if it doesn't exist.

Implements org.knopflerfish.framework.BundleArchive.

Definition at line 328 of file file/BundleArchiveImpl.java.

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

InputStream org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl.getInputStream ( String  component,
int  ix 
)

Get an specific InputStream to named entry inside a bundle.

Leading '/' is stripped.

Parameters:
component Entry to get reference to.
ix index of sub archives. A postive number is the classpath entry index. -1 means look in the main bundle.
Returns:
InputStream to entry or null if it doesn't exist.

Implements org.knopflerfish.framework.BundleArchive.

Definition at line 362 of file file/BundleArchiveImpl.java.

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

String org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl.getNativeLibrary ( String  libName  ) 

Get native library from JAR.

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

Implements org.knopflerfish.framework.BundleArchive.

Definition at line 382 of file file/BundleArchiveImpl.java.

boolean org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl.getStartOnLaunchFlag (  ) 

Get state of start on launch flag.

Returns:
Boolean value for start on launch flag.

Implements org.knopflerfish.framework.BundleArchive.

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

void org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl.setStartOnLaunchFlag ( boolean  value  )  throws IOException

Set state of start on launch flag.

Parameters:
value Boolean value for start on launch flag.

Implements org.knopflerfish.framework.BundleArchive.

Definition at line 437 of file file/BundleArchiveImpl.java.

void org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl.purge (  ) 

Remove bundle archive from persistent storage.

If we removed the active revision also remove bundle status files.

Implements org.knopflerfish.framework.BundleArchive.

Definition at line 449 of file file/BundleArchiveImpl.java.

void org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl.close (  ) 

Close archive for further access.

It should still be possible to get attributes.

Implements org.knopflerfish.framework.BundleArchive.

Definition at line 470 of file file/BundleArchiveImpl.java.

List org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl.getFailedClassPathEntries (  ) 

Get a list with all classpath entries we failed to locate.

Returns:
A List with all failed classpath entries, null if no failures.

Implements org.knopflerfish.framework.BundleArchive.

Definition at line 483 of file file/BundleArchiveImpl.java.

static boolean org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl.isUninstalled ( File  dir  )  [static, package]

Statically check if a directory contains info that a bundle is uninstalled.

Uninstalled is marked via a startlevel of -2. If last modified file is not available then the bundle is not complete.

Definition at line 522 of file file/BundleArchiveImpl.java.

Enumeration org.knopflerfish.framework.bundlestorage.file.BundleArchiveImpl.findResourcesPath ( String  path  ) 

Returns an Enumeration of all the paths (String objects) to entries within the bundle whose longest sub-path matches the supplied path argument.

Parameters:
name 
Returns:

Implements org.knopflerfish.framework.BundleArchive.

Definition at line 761 of file file/BundleArchiveImpl.java.


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