com.threerings.resource
Class Handler

java.lang.Object
  extended by java.net.URLStreamHandler
      extended by com.threerings.resource.Handler

public class Handler
extends URLStreamHandler

This class is not used directly, except by a registering ResourceManager so that we can load data from the resource manager using URLs of the form resource://<resourceSet>/<path>. ResourceSet may be the empty string to load from the default resource sets.


Field Summary
protected static ResourceManager _rmgr
          Our singleton resource manager.
 
Constructor Summary
Handler()
           
 
Method Summary
protected  boolean equals(URL u1, URL u2)
           
protected  InputStream getStream(String bundle, String path, String query)
          Does some magic to allow a subset of an image to be extracted, reencoded as a PNG and then spat back out to the Java content handler system for inclusion in internal documentation.
protected  int hashCode(URL url)
           
protected  URLConnection openConnection(URL url)
           
static void registerHandler(ResourceManager rmgr)
          Register this class to handle "resource" urls ("resource://resourceSet/path") with the specified ResourceManager.
 
Methods inherited from class java.net.URLStreamHandler
getDefaultPort, getHostAddress, hostsEqual, openConnection, parseURL, sameFile, setURL, setURL, toExternalForm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_rmgr

protected static ResourceManager _rmgr
Our singleton resource manager.

Constructor Detail

Handler

public Handler()
Method Detail

registerHandler

public static void registerHandler(ResourceManager rmgr)
Register this class to handle "resource" urls ("resource://resourceSet/path") with the specified ResourceManager.


hashCode

protected int hashCode(URL url)
Overrides:
hashCode in class URLStreamHandler

equals

protected boolean equals(URL u1,
                         URL u2)
Overrides:
equals in class URLStreamHandler

openConnection

protected URLConnection openConnection(URL url)
                                throws IOException
Specified by:
openConnection in class URLStreamHandler
Throws:
IOException

getStream

protected InputStream getStream(String bundle,
                                String path,
                                String query)
                         throws IOException
Does some magic to allow a subset of an image to be extracted, reencoded as a PNG and then spat back out to the Java content handler system for inclusion in internal documentation.

Throws:
IOException