Class BundleEntry
java.lang.Object
org.eclipse.osgi.storage.bundlefile.BundleEntry
- Direct Known Subclasses:
DirZipBundleEntry
,FileBundleEntry
,ZipBundleEntry
A BundleEntry represents one entry of a BundleFile.
Clients may extend this class.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getBytes()
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
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.toString()
Return the name of this BundleEntry by calling getName().
-
Field Details
-
BUF_SIZE
protected static final int BUF_SIZE- See Also:
-
-
Constructor Details
-
BundleEntry
public BundleEntry()
-
-
Method Details
-
getInputStream
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
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
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
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
Return the name of this BundleEntry by calling getName(). -
getBytes
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
-