org.jqurantree.core.resource
Class ResourceUtil

java.lang.Object
  extended by org.jqurantree.core.resource.ResourceUtil

public class ResourceUtil
extends java.lang.Object

Utiltiy class which provides convenience methods for accessing embedded JAR resources.

Author:
Kais Dukes

Method Summary
static java.lang.String getText(java.lang.String resourcePath)
          Opens an embedded JAR resource, reads the entire content as text, then closes the resource.
static java.io.InputStream open(java.lang.String resourcePath)
          Opens an embedded JAR resource for reading.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

open

public static java.io.InputStream open(java.lang.String resourcePath)
Opens an embedded JAR resource for reading.

Parameters:
resourcePath - the full path and name of the resource, e.g. /foo/bar.txt
Returns:
an open InputStream used to read the resource.
Throws:
JQuranTreeException - if the resource does not exist

getText

public static java.lang.String getText(java.lang.String resourcePath)
Opens an embedded JAR resource, reads the entire content as text, then closes the resource.

Parameters:
resourcePath - the full path and name of the resource, e.g. /foo/bar.txt
Returns:
a string containing the entire text content of the resource
Throws:
JQuranTreeException - if the resource does not exist


Copyright© Kais Dukes, 2009. All Rights Reserved.