NextApp Echo
App Container 1.0.5

nextapp.echoservlet.util
Class Resource

java.lang.Object
  extended bynextapp.echoservlet.util.Resource

public class Resource
extends java.lang.Object

Provides functionality for obtaining text and binary resource files.


Nested Class Summary
static class Resource.ResourceException
          A RuntimeException exception that will be thrown in the event that problems are encountered obtaining a resource.
 
Field Summary
private static int BUFFER_SIZE
           
 
Constructor Summary
private Resource()
          Non-instantiable class.
 
Method Summary
private static java.io.ByteArrayOutputStream getResource(java.lang.String resourceName)
          An internal method used to retrieve a resource as a ByteArrayOutputStream.
static byte[] getResourceAsByteArray(java.lang.String resourceName)
          Retrieves the specified resource as an array of bytes.
static java.lang.String getResourceAsString(java.lang.String resourceName)
          Retrieves the specified resource as a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUFFER_SIZE

private static final int BUFFER_SIZE
See Also:
Constant Field Values
Constructor Detail

Resource

private Resource()
Non-instantiable class.

Method Detail

getResourceAsString

public static java.lang.String getResourceAsString(java.lang.String resourceName)
Retrieves the specified resource as a String.

Parameters:
resourceName - The name of the resource to be retrieved.
Returns:
The specified resource as a String.

getResourceAsByteArray

public static byte[] getResourceAsByteArray(java.lang.String resourceName)
Retrieves the specified resource as an array of bytes.

Parameters:
resourceName - The name of the resource to be retrieved.
Returns:
The specified resource as an array of bytes.

getResource

private static java.io.ByteArrayOutputStream getResource(java.lang.String resourceName)
An internal method used to retrieve a resource as a ByteArrayOutputStream.

Parameters:
resourceName - The name of the resource to be retrieved.
Returns:
A ByteArrayOutputStream of the content of the resource.

NextApp Echo
App Container 1.0.5