A bundle is considered to be a simple immutable container of data by the perspective of the Nest repository. This interface provides functions that can be used to access the contents of it.
The contents may be interpreted in any way suitable for the caller.
This interface is not related to any current storage configurations, it only serves as a handle to the contents of a bundle. Bundles may be shared internally by different storage configurations.
This interface is not to be implemented by clients.
public default BundleIdentifier | Gets the identifier of the bundle. |
public Path | Gets the path to the bundle-private storage directory. |
public default ByteArrayRegion | getEntryBytes( Gets the full byte array contents of the given entry. |
public NavigableSet< | Gets the names of entries in this bundle. |
public byte[] | getHash() Gets a hash of the contents of the bundle. |
public BundleInformation | Gets the bundle information associated with this bundle. |
public BundleStorage | Gets the bundle storage that this bundle is contained in. |
public default boolean | Checks if a given entry with the specified name is present in the bundle. |
public InputStream | Opens a byte input stream to the contents of the entry with the given name. |
The returned identifier can have arbitrary contents specified by the BundleIdentifier class. It may or may not contain any version qualifiers.
null
.Each bundle is provided with a private storage that they can use to store arbitrary data. It can be mainly used for caching purposes. The storage directory can be cleared at any moment, and clients shouldn't store crucial data in it.
One example use-case for it is to extract bundle entries to this directory which is later then passed to external processes as an input.
null
.Directory entries are not included.
The hasEntry(true
for any entry name contained in the returned
set.
The hash is produced by hashing the raw byte contents of the bundle itself. If the bundle was compressed, the contents are not uncompressed for hashing. In case of JAR bundles, the bytes of the JAR is used to produce the hash.
Hashes of dependencies are not included.
The hash algorithm is implementation dependent.
null
.)
If the argument is null
, this method returns false
.
true
if the entry is present.The returned stream must be closed by the caller.
null
.