org.xfp.filters.convert
Class InputStreamToString

java.lang.Object
  extended byorg.xfp.AttributeContainer
      extended byorg.xfp.Filter
          extended byorg.xfp.filters.convert.InputStreamToString

public class InputStreamToString
extends Filter

Converts an InputStream to a string.

Version:
$Id: InputStreamToString.java,v 1.1 2004/03/19 15:56:46 flaviotordini Exp $
Author:
Flavio Tordini

Nested Class Summary
 
Nested classes inherited from class org.xfp.Filter
Filter.OnErrorEnum, Filter.OnLoopErrorEnum
 
Field Summary
 
Fields inherited from class org.xfp.AttributeContainer
name, parentContainer
 
Constructor Summary
InputStreamToString()
           
 
Method Summary
 java.lang.String execute(java.io.InputStream is)
          Executes this filter.
protected static java.lang.String inputStreamToString(java.io.InputStream is, java.lang.String encoding)
          Read the content of a Stream into a String
 void reset()
          Resets filter status after execution.
 void setEncoding(java.lang.String encoding)
          Sets the encoding attribute of the HTTPGet object
 
Methods inherited from class org.xfp.Filter
getOnError, initialize, log, newInstance, perform, toString
 
Methods inherited from class org.xfp.AttributeContainer
configureAttributes, disposeAttributes, getAttributes, getFullName, getName, initializeAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InputStreamToString

public InputStreamToString()
Method Detail

setEncoding

public void setEncoding(java.lang.String encoding)
Sets the encoding attribute of the HTTPGet object

Parameters:
encoding - The new encoding value

execute

public java.lang.String execute(java.io.InputStream is)
                         throws java.lang.Exception
Executes this filter.

Returns:
outputs filtered input data
Throws:
java.lang.Exception - any exception

reset

public void reset()
Description copied from class: Filter
Resets filter status after execution. This method is called after execute(), even in case of exceptions. Since a Filter instance may be reused (and actually is), you must use this method to reset all your class members to their default value.

Specified by:
reset in class Filter
See Also:
Filter.reset()

inputStreamToString

protected static java.lang.String inputStreamToString(java.io.InputStream is,
                                                      java.lang.String encoding)
                                               throws java.io.IOException
Read the content of a Stream into a String

Returns:
the String containing the input stream
Throws:
java.io.IOException


Copyright © 2003-2004 XFP Team. All Rights Reserved.