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
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    Used for class loading.
    abstract URL
    Get a URL to the content of the bundle entry that uses the file: protocol.
    abstract InputStream
    Return an InputStream for the entry.
    abstract URL
    Get a URL to the bundle entry that uses a common protocol (i.e. file: jar: or http: etc.).
    abstract String
    Return the name of the entry.
    abstract long
    Return the size of the entry (uncompressed).
    abstract long
    Get the modification time for this BundleEntry.
    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

  • 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