public class StreamSubstituter extends Object
Constructor and Description |
---|
StreamSubstituter() |
Modifier and Type | Method and Description |
---|---|
void |
define(String key,
String val)
Define a string to substitute.
|
void |
filter(File inputFile,
PrintWriter o)
Filters data from file.
|
StringBuffer |
getFileContents(File filename)
Get file content from file to string buffer
|
public void define(String key, String val)
<subst data="key">otherwise</subst>will be replaced with the value defined for "key". If the key has not been defined, then "otherwise" will be copied to the output stream. More than one
date="key"
may be specified in the same
<subst> tag in which case they are substituted in order, and
"otherwise" is only copied if none of the keys were found.key
- file name used as key for cacheval
- string value for representation of the filepublic void filter(File inputFile, PrintWriter o) throws IOException
inputFile
- that filter will be applied.o
- output stream filtered content will be written.IOException
- if content can not be read frompublic StringBuffer getFileContents(File filename) throws Exception
filename
- will be read fromException
- if file can not be read from.Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.