Package org.eclipse.osgi.storage.bundlefile

# Class BundleEntry

java.lang.Object
org.eclipse.osgi.storage.bundlefile.BundleEntry

Direct Known Subclasses:
  `DirZipBundleEntry`, `FileBundleEntry`, `ZipBundleEntry`

public abstract class BundleEntry extends Object
A BundleEntry represents one entry of a BundleFile.

Clients may extend this class.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected static final int`
`BUF_SIZE`

## Constructor Summary

Constructors
Constructor
Description
`BundleEntry()`

## Method Summary

Modifier and Type
Method
Description
`byte[]`
`getBytes()`
Used for class loading.
`abstract URL`
`getFileURL()`
Get a URL to the content of the bundle entry that uses the file: protocol.
`abstract InputStream`
`getInputStream()`
Return an InputStream for the entry.
`abstract URL`
`getLocalURL()`
Get a URL to the bundle entry that uses a common protocol (i.e. file: jar: or http: etc.).
`abstract 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.
`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 Details

### BUF_SIZE

protected static final int BUF_SIZE

See Also:
  - Constant Field Values

## Constructor Details

### BundleEntry

public BundleEntry()

## Method Details

### getInputStream

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

Returns:
  InputStream for the entry.
Throws:
  `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 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 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 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 String toString()
Return the name of this BundleEntry by calling getName().

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

### getBytes

public byte[] getBytes() throws 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:
  `IOException`