io
Class ResourceHandler

java.lang.Object
  extended by io.ResourceHandler

public class ResourceHandler
extends java.lang.Object

A class for dealing with resources within the jar file or from an external location like the local Filesystem or a Http resource.

Author:
Peter Hlavac

Constructor Summary
ResourceHandler()
           
 
Method Summary
 byte[] loadResourceAsByteArray(java.lang.String resource)
          Returns a given resource as a stream.
 java.lang.String loadResourceAsStringBuffer(java.lang.String resource)
          Converts a given resource into a string.
 boolean resourceExists(java.lang.String resource)
          Checks if resource exists in jar file
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceHandler

public ResourceHandler()
Method Detail

resourceExists

public boolean resourceExists(java.lang.String resource)
Checks if resource exists in jar file

Parameters:
resource - The resource to check
Returns:
TRUE if resource exits, FALSE otherwise

loadResourceAsStringBuffer

public java.lang.String loadResourceAsStringBuffer(java.lang.String resource)
Converts a given resource into a string. A resource could be from the

Parameters:
resource - a resource, that is loaded into a stringbuffer
Returns:
the resource converted to a string

loadResourceAsByteArray

public byte[] loadResourceAsByteArray(java.lang.String resource)
Returns a given resource as a stream. A resource could be from the

Parameters:
resource - the resource
Returns:
the resource stream