com.threerings.resource
Class NetworkResourceBundle

java.lang.Object
  extended by com.threerings.resource.ResourceBundle
      extended by com.threerings.resource.KnownAvailabilityResourceBundle
          extended by com.threerings.resource.NetworkResourceBundle

public class NetworkResourceBundle
extends KnownAvailabilityResourceBundle

Resource bundle that retrieves its contents via HTTP over the network from a root URL.


Field Summary
protected  URL _bundleURL
          Our root url to the resources in this bundle.
protected  String _ident
          Our identifier for this bundle.
 
Fields inherited from class com.threerings.resource.KnownAvailabilityResourceBundle
_rsrcs
 
Constructor Summary
NetworkResourceBundle(String root, String path, Set<String> rsrcList)
           
 
Method Summary
 String getIdent()
          Uniquely identifies this resource bundle.
 BufferedImage getImageResource(String path, boolean useFastIO)
          Decodes and returns the specified image resource.
 InputStream getResource(String path)
          Fetches the named resource from this bundle.
protected static InputStream getResource(URL resourceUrl)
           
 String toString()
          Returns a string representation of this resource bundle.
 
Methods inherited from class com.threerings.resource.KnownAvailabilityResourceBundle
isPossiblyAvailable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_ident

protected String _ident
Our identifier for this bundle.


_bundleURL

protected URL _bundleURL
Our root url to the resources in this bundle.

Constructor Detail

NetworkResourceBundle

public NetworkResourceBundle(String root,
                             String path,
                             Set<String> rsrcList)
Method Detail

getIdent

public String getIdent()
Description copied from class: ResourceBundle
Uniquely identifies this resource bundle. Used to create cache keys.

Specified by:
getIdent in class ResourceBundle

getResource

public InputStream getResource(String path)
                        throws IOException
Description copied from class: ResourceBundle
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.

Specified by:
getResource in class ResourceBundle
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.

getResource

protected static InputStream getResource(URL resourceUrl)

getImageResource

public BufferedImage getImageResource(String path,
                                      boolean useFastIO)
                               throws IOException
Description copied from class: ResourceBundle
Decodes and returns the specified image resource. Returns null if no resource exists at the specified path.

Specified by:
getImageResource in class ResourceBundle
Throws:
IOException

toString

public String toString()
Returns a string representation of this resource bundle.

Overrides:
toString in class Object