org.spicefactory.cinnamon.config.resource
Class HttpResource

java.lang.Object
  extended by org.spicefactory.cinnamon.config.resource.AbstractResource
      extended by org.spicefactory.cinnamon.config.resource.HttpResource
All Implemented Interfaces:
Resource

public class HttpResource
extends AbstractResource

Resource implementation that loads a resource via HTTP.

Author:
Jens Halm

Constructor Summary
HttpResource(String url)
          Creates a new HTTP resource for the given url.
 
Method Summary
 InputStream getInputStream()
          Creates an InputStream for this Resource.
 void setPassword(String password)
          Sets an optional password if authentication is required to load the resource.
 void setUsername(String username)
          Sets an optional username if authentication is required to load the resource.
 
Methods inherited from class org.spicefactory.cinnamon.config.resource.AbstractResource
getPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpResource

public HttpResource(String url)
Creates a new HTTP resource for the given url.

Parameters:
url - the absolute HTTP URL to load the resource from.
Method Detail

setPassword

public void setPassword(String password)
Sets an optional password if authentication is required to load the resource.

Parameters:
password - the password to use for authentication

setUsername

public void setUsername(String username)
Sets an optional username if authentication is required to load the resource.

Parameters:
username - the username to use for authentication

getInputStream

public InputStream getInputStream()
Description copied from interface: Resource
Creates an InputStream for this Resource.

Returns:
an InputStream for this Resource