com.threerings.resource
Class ResourceBundle

java.lang.Object
  extended by com.threerings.resource.ResourceBundle
Direct Known Subclasses:
FileResourceBundle, KnownAvailabilityResourceBundle

public abstract class ResourceBundle
extends Object

A resource bundle provides access to media resources.


Constructor Summary
ResourceBundle()
           
 
Method Summary
abstract  String getIdent()
          Uniquely identifies this resource bundle.
abstract  BufferedImage getImageResource(String path, boolean useFastIO)
          Decodes and returns the specified image resource.
abstract  InputStream getResource(String path)
          Fetches the named resource from this bundle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceBundle

public ResourceBundle()
Method Detail

getIdent

public abstract String getIdent()
Uniquely identifies this resource bundle. Used to create cache keys.


getResource

public abstract InputStream getResource(String path)
                                 throws IOException
Fetches the named resource from this bundle. The path should be specified as a relative, platform independent path (forward slashes). For example sounds/scream.au.

Parameters:
path - the path to the resource in this jar file.
Returns:
an input stream from which the resource can be loaded or null if no such resource exists.
Throws:
IOException - thrown if an error occurs locating the resource in the jar file.

getImageResource

public abstract BufferedImage getImageResource(String path,
                                               boolean useFastIO)
                                        throws IOException
Decodes and returns the specified image resource. Returns null if no resource exists at the specified path.

Throws:
IOException