org.jqurantree.core.resource
Class ResourceReader

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

public class ResourceReader
extends java.lang.Object

Utility class which supports reading lines of text from an embedded JAR resource.

Author:
Kais Dukes

Constructor Summary
ResourceReader(java.lang.String resourcePath)
          Creates a new resource reader.
 
Method Summary
 void close()
          Closes the resource.
 java.lang.String readLine()
          Reads a line of text from the resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceReader

public ResourceReader(java.lang.String resourcePath)
Creates a new resource reader.

Parameters:
resourcePath - the full path and name of the resource, e.g. /foo/bar.txt
Throws:
JQuranTreeException - if the resource does not exist
Method Detail

readLine

public java.lang.String readLine()
Reads a line of text from the resource.

Returns:
a string containing the contents of the line, not including line break, or null if the end of the resource has been reached.

close

public void close()
Closes the resource.



Copyright© Kais Dukes, 2009. All Rights Reserved.