Class AssetManager

java.lang.Object
com.pnfsoftware.jeb.core.AssetManager

public class AssetManager extends Object
Manager for Core assets.
  • Constructor Details

    • AssetManager

      public AssetManager()
  • Method Details

    • getAsset

      public static InputStream getAsset(String name) throws IOException
      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

      public static boolean isAsset(String name)
      Determine whether a bundled core asset exists.
      Parameters:
      name - asset name relative to the core asset directory
      Returns:
      true if the asset exists
    • getAssetBytes

      public static byte[] getAssetBytes(String name)
      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

      public static int getAssetSize(String name)
      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