org.nakedobjects.metamodel.commons.resource
Class ResourceStreamSourceAbstract

java.lang.Object
  extended by org.nakedobjects.metamodel.commons.resource.ResourceStreamSourceAbstract
All Implemented Interfaces:
ResourceStreamSource
Direct Known Subclasses:
ResourceStreamSourceComposite, ResourceStreamSourceContextLoaderClassPath, ResourceStreamSourceCurrentClassClassPath, ResourceStreamSourceFileSystem

public abstract class ResourceStreamSourceAbstract
extends java.lang.Object
implements ResourceStreamSource


Constructor Summary
ResourceStreamSourceAbstract()
           
 
Method Summary
protected abstract  java.io.InputStream doReadResource(java.lang.String resourcePath)
          Mandatory hook method; subclasses can return either null or throw an exception if the resource could not be found.
 java.io.InputStream readResource(java.lang.String resourcePath)
          Returns an InputStream opened for the resource path, or null otherwise.
 java.io.OutputStream writeResource(java.lang.String resourcePath)
          Default implementation returns null (that is, not supported).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.nakedobjects.metamodel.commons.resource.ResourceStreamSource
getName
 

Constructor Detail

ResourceStreamSourceAbstract

public ResourceStreamSourceAbstract()
Method Detail

readResource

public final java.io.InputStream readResource(java.lang.String resourcePath)
Description copied from interface: ResourceStreamSource
Returns an InputStream opened for the resource path, or null otherwise.

Specified by:
readResource in interface ResourceStreamSource

doReadResource

protected abstract java.io.InputStream doReadResource(java.lang.String resourcePath)
                                               throws java.io.IOException
Mandatory hook method; subclasses can return either null or throw an exception if the resource could not be found.

Throws:
java.io.IOException

writeResource

public java.io.OutputStream writeResource(java.lang.String resourcePath)
Default implementation returns null (that is, not supported).

Specified by:
writeResource in interface ResourceStreamSource


Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.