Service Management Framework
Release 3.1

com.ibm.osg.smf.platform
Class BundleFile

java.lang.Object
  |
  +--com.ibm.osg.smf.platform.BundleFile
Direct Known Subclasses:
BundleFile.File, BundleFile.OSMemory

public class BundleFile
extends java.lang.Object

This class represents a bundle file.

This class should be subclassed to model bundle files in different data stores.

The bundle may be in JAR format or JXE format, when running on IBM VisualAge Micro Edition.


Inner Class Summary
static class BundleFile.File
          Implementation of BundleFile using a File for the bundle storage.
static class BundleFile.OSMemory
          Implementation of BundleFile using an OSMemory for the bundle storage.
 
Constructor Summary
BundleFile()
          Default constructor for subclasses to use.
 
Method Summary
 void close()
          Closes the BundleFile.
 BundleEntry getEntry(java.lang.String name)
          Returns a BundleEntry object for the named entry in the bundle.
 java.io.InputStream getInputStream()
          Return an InputStream for the bundle.
 java.lang.String getName()
          Return name of the bundle.
 long getSize()
          Returns size of the bundle.
 void open()
          Open the BundleFile.
 com.ibm.oti.vm.Jxe toJxe()
          Create and return a Jxe object for the bundle.
 java.lang.String toString()
          Return the name of this BundleFile by calling getName().
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BundleFile

public BundleFile()
Default constructor for subclasses to use.
Method Detail

open

public void open()
          throws java.io.IOException
Open the BundleFile. This method will reopen the BundleFile if it has been previously closed.
Throws:
java.io.IOException - If an error occurs opening the bundle.

close

public void close()
Closes the BundleFile.

getEntry

public BundleEntry getEntry(java.lang.String name)
Returns a BundleEntry object for the named entry in the bundle.
Parameters:
name - Name of the entry in the bundle.
Returns:
BundleEntry object or null if the entry does not exist in the bundle.

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Return an InputStream for the bundle.
Returns:
InputSteam for complete bundle.
Throws:
java.io.IOException - If an error occurs reading the bundle.

getSize

public long getSize()
Returns size of the bundle.
Returns:
size of the bundle.

getName

public java.lang.String getName()
Return name of the bundle.
Returns:
name of bundle.

toJxe

public com.ibm.oti.vm.Jxe toJxe()
                         throws com.ibm.oti.vm.JxeException,
                                java.io.IOException
Create and return a Jxe object for the bundle.

This method is only for use when running on IBM VisualAge Micro Edition.

Throws:
java.io.IOException - If an error occurs reading the bundle.
com.ibm.oti.vm.JxeException - If an error occurs creating the Jxe object.

toString

public java.lang.String toString()
Return the name of this BundleFile by calling getName().
Overrides:
toString in class java.lang.Object
Returns:
String representation of this BundleFile.

Service Management Framework
Release 3.1

Licensed Materials - Property of IBM. (C) Copyright IBM Corp. 2000, 2002 All Rights Reserved. IBM is a registered trademark of IBM Corp.