org.jcon.store
Class ClassResourceStore

java.lang.Object
  extended by org.jcon.store.ClassResourceStore
All Implemented Interfaces:
StreamingStore

public class ClassResourceStore
extends java.lang.Object
implements StreamingStore

A read-only store that uses the java class resource mechanism.

This store uses the java classpath to find stored resources, which it can get Readers for. These resources might be in a local filesystem, on a WWW site, in jar or zip files, or what-have-you.

Due to the nature of class resources, however, this is a read-only store.

Author:
Paul Reavis

Constructor Summary
ClassResourceStore()
           
 
Method Summary
 java.io.Reader readerFor(java.lang.String storagePath)
          Returns an input stream for the given storage path.
static ClassResourceStore singleton()
          Since there's only one classpath for a VM, there's not much need in having more than one of these, so here's a statically-defined singleton.
 java.io.Writer writerFor(java.lang.String storagePath)
          Since this is a read-only store, always throws a StoreException.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassResourceStore

public ClassResourceStore()
Method Detail

singleton

public static ClassResourceStore singleton()
Since there's only one classpath for a VM, there's not much need in having more than one of these, so here's a statically-defined singleton.


readerFor

public java.io.Reader readerFor(java.lang.String storagePath)
Returns an input stream for the given storage path.

Specified by:
readerFor in interface StreamingStore

writerFor

public java.io.Writer writerFor(java.lang.String storagePath)
                         throws StoreException
Since this is a read-only store, always throws a StoreException.

Specified by:
writerFor in interface StreamingStore
Throws:
StoreException