org.opensaml.util.resource
Class PropertyReplacementResourceFilter

java.lang.Object
  extended by org.opensaml.util.resource.PropertyReplacementResourceFilter
All Implemented Interfaces:
ResourceFilter

public class PropertyReplacementResourceFilter
extends Object
implements ResourceFilter

A resource filter that buffers a resource into a string and replaces instance of macros with properties read from a file. Macros are of the syntax '${MACRO_NAME}', the same syntax used within the Java Expression Language. The property file is read at invocation of this filter. The InputStream should be a character stream as InputStreamReader will be used to convert the stream into a string.


Constructor Summary
PropertyReplacementResourceFilter(File propertyFile)
          Constructor.
 
Method Summary
 InputStream applyFilter(InputStream resource)
          Applies this filter to the given stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyReplacementResourceFilter

public PropertyReplacementResourceFilter(File propertyFile)
Constructor.

Parameters:
propertyFile - property file whose properties will be expanded within the resource
Method Detail

applyFilter

public InputStream applyFilter(InputStream resource)
                        throws ResourceException
Applies this filter to the given stream.

Specified by:
applyFilter in interface ResourceFilter
Parameters:
resource - Resource to which the filter should apply.
Returns:
filtered stream
Throws:
ResourceException - thrown is there if a problem applying the filter


Copyright © 2006-2013 Internet2. All Rights Reserved.