Package com.pnfsoftware.jeb.core
Class AssetManager
java.lang.Object
com.pnfsoftware.jeb.core.AssetManager
Manager for Core assets.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic InputStreamOpen a bundled core asset as a stream.static byte[]getAssetBytes(String name) Load a bundled core asset into memory.static intgetAssetSize(String name) Retrieve the size of a bundled core asset.static booleanDetermine whether a bundled core asset exists.
-
Constructor Details
-
AssetManager
public AssetManager()
-
-
Method Details
-
getAsset
Open a bundled core asset as a stream.- Parameters:
name- asset name relative to the core asset directory- Returns:
- input stream for the requested asset (must be closed by the caller)
- Throws:
IOException- if the asset does not exist
-
isAsset
Determine whether a bundled core asset exists.- Parameters:
name- asset name relative to the core asset directory- Returns:
- true if the asset exists
-
getAssetBytes
Load a bundled core asset into memory.- Parameters:
name- asset name relative to the core asset directory- Returns:
- asset bytes, or null if the asset could not be loaded
-
getAssetSize
Retrieve the size of a bundled core asset.- Parameters:
name- asset name relative to the core asset directory- Returns:
- asset size in bytes, or -1 on error
-