All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class uhr.core.dk.ClassResourceReader

java.lang.Object
   |
   +----uhr.core.dk.ClassResourceReader

public class ClassResourceReader
extends Object
This class handles reads for class resource type persistence. This involves reading files using a class marker and resource name, aka file name. The file name is relative to the class marker location on disk.

By using a class marker, not a class name, we preserve class loader location, allowing things such as applets to use class resource text off the web.

We use a separate class for reader to allow a smaller deployment package where writes are not needed, and to simplify the reader and writer classes.


Constructor Index

 o ClassResourceReader()

Method Index

 o readText(Class, String)
Reads the text in the resource for the marker.

Constructors

 o ClassResourceReader
 public ClassResourceReader()

Methods

 o readText
 public String readText(Class marker,
                        String resource)
Reads the text in the resource for the marker. This is done with the useful Class.getResourseAsStream().

Parameters:
marker - the class marker to use.
resource - the file name, aka resource, to read.
Throws: IllegalArgumentException
if marker or resource are null.
Throws: IllegalStateException
if file not found or unable to read.

All Packages  Class Hierarchy  This Package  Previous  Next  Index