org.ujac.util.io
Class HttpResourceLoader

java.lang.Object
  extended by org.ujac.util.io.HttpResourceLoader
All Implemented Interfaces:
ResourceLoader

public class HttpResourceLoader
extends Object
implements ResourceLoader

Name: HttpResourceLoader
Description: A resource loader which loads resources from network using the http protocol.

Author:
lauerc

Constructor Summary
HttpResourceLoader()
          Constructs a HttpResourceLoader instance with no specific attributes.
HttpResourceLoader(String urlRoot)
          Constructs a HttpResourceLoader instance with specific attributes.
 
Method Summary
 byte[] loadResource(String location)
          Loads a binary resource.
 boolean resourceExists(String location)
          Checks whether or not the desired resource exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpResourceLoader

public HttpResourceLoader()
Constructs a HttpResourceLoader instance with no specific attributes.


HttpResourceLoader

public HttpResourceLoader(String urlRoot)
Constructs a HttpResourceLoader instance with specific attributes.

Parameters:
urlRoot - The root location.
Method Detail

loadResource

public byte[] loadResource(String location)
                    throws IOException
Description copied from interface: ResourceLoader
Loads a binary resource.

Specified by:
loadResource in interface ResourceLoader
Parameters:
location - The location of the resource.
Returns:
The loaded resource.
Throws:
IOException - In case the loading of the resource failed.
See Also:
ResourceLoader.loadResource(java.lang.String)

resourceExists

public boolean resourceExists(String location)
Checks whether or not the desired resource exists.

Specified by:
resourceExists in interface ResourceLoader
Parameters:
location - The location of the resource.
Returns:
true in case the given resource could be located, else false.


Copyright © 2003-2004 UJAC.org. All Rights Reserved.