org.eclipse.osgi.baseadaptor.bundlefile
Class BundleEntry

java.lang.Object
  extended by org.eclipse.osgi.baseadaptor.bundlefile.BundleEntry
Direct Known Subclasses:
DirZipBundleEntry, FileBundleEntry, ZipBundleEntry

public abstract class BundleEntry
extends java.lang.Object

A BundleEntry represents one entry of a BundleFile.

Clients may extend this class.

Since:
3.2

Field Summary
protected static int BUF_SIZE
           
 
Constructor Summary
BundleEntry()
           
 
Method Summary
 byte[] getBytes()
          Used for class loading.
abstract  java.net.URL getFileURL()
          Get a URL to the content of the bundle entry that uses the file: protocol.
abstract  java.io.InputStream getInputStream()
          Return an InputStream for the entry.
abstract  java.net.URL getLocalURL()
          Get a URL to the bundle entry that uses a common protocol (i.e. file: jar: or http: etc.).
abstract  java.lang.String getName()
          Return the name of the entry.
abstract  long getSize()
          Return the size of the entry (uncompressed).
abstract  long getTime()
          Get the modification time for this BundleEntry.
 java.lang.String toString()
          Return the name of this BundleEntry by calling getName().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BUF_SIZE

protected static final int BUF_SIZE
See Also:
Constant Field Values
Constructor Detail

BundleEntry

public BundleEntry()
Method Detail

getInputStream

public abstract java.io.InputStream getInputStream()
                                            throws java.io.IOException
Return an InputStream for the entry.

Returns:
InputStream for the entry.
Throws:
java.io.IOException - If an error occurs reading the bundle.

getSize

public abstract long getSize()
Return the size of the entry (uncompressed).

Returns:
size of entry.

getName

public abstract java.lang.String getName()
Return the name of the entry.

Returns:
name of entry.

getTime

public abstract long getTime()
Get the modification time for this BundleEntry.

If the modification time has not been set, this method will return -1.

Returns:
last modification time.

getLocalURL

public abstract java.net.URL getLocalURL()
Get a URL to the bundle entry that uses a common protocol (i.e. file: jar: or http: etc.).

Returns:
a URL to the bundle entry that uses a common protocol

getFileURL

public abstract java.net.URL getFileURL()
Get a URL to the content of the bundle entry that uses the file: protocol. The content of the bundle entry may be downloaded or extracted to the local file system in order to create a file: URL.

Returns:
a URL to the content of the bundle entry that uses the file: protocol

toString

public java.lang.String toString()
Return the name of this BundleEntry by calling getName().

Overrides:
toString in class java.lang.Object
Returns:
String representation of this BundleEntry.

getBytes

public byte[] getBytes()
                throws java.io.IOException
Used for class loading. This default implementation gets the input stream from this entry and copies the content into a byte array.

Returns:
a byte array containing the content of this entry
Throws:
java.io.IOException