org.opensaml.util.resource
Class AbstractFilteredResource

java.lang.Object
  extended by org.opensaml.util.resource.AbstractFilteredResource
All Implemented Interfaces:
Resource
Direct Known Subclasses:
ClasspathResource, FilesystemResource, HttpResource

public abstract class AbstractFilteredResource
extends Object
implements Resource

A Resource whose contents may be run through a filter as it is being read.


Constructor Summary
protected AbstractFilteredResource()
          Constructor.
protected AbstractFilteredResource(ResourceFilter filter)
          Deprecated. use setResourceFilter(ResourceFilter) instead
 
Method Summary
protected  InputStream applyFilter(InputStream stream)
          Applies the filter to the given stream resulting in the returned stream.
 ResourceFilter getResourceFilter()
          Gets the resource filter associated with this resource.
 void setResourceFilter(ResourceFilter filter)
          Sets the resource filter associated with this resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opensaml.util.resource.Resource
exists, getInputStream, getLastModifiedTime, getLocation
 

Constructor Detail

AbstractFilteredResource

protected AbstractFilteredResource()
Constructor.


AbstractFilteredResource

protected AbstractFilteredResource(ResourceFilter filter)
Deprecated. use setResourceFilter(ResourceFilter) instead

Constructor.

Parameters:
filter - the filter used on the resource
Method Detail

getResourceFilter

public ResourceFilter getResourceFilter()
Gets the resource filter associated with this resource.

Returns:
resource filter associated with this resource

setResourceFilter

public void setResourceFilter(ResourceFilter filter)
Sets the resource filter associated with this resource.

Parameters:
filter - filter associated with this resource

applyFilter

protected InputStream applyFilter(InputStream stream)
                           throws ResourceException
Applies the filter to the given stream resulting in the returned stream. If no filter is set than the given stream is the returned stream.

Parameters:
stream - the stream to filter
Returns:
the filtered stream
Throws:
ResourceException - thrown if the filter can not be applied to the stream


Copyright © 2006-2013 Internet2. All Rights Reserved.