it.geosolutions.tools.io.file.reader
Class TextReader

java.lang.Object
  extended by it.geosolutions.tools.io.file.reader.TextReader

public class TextReader
extends Object


Constructor Summary
TextReader()
           
 
Method Summary
static String toString(File file)
          Get the contents of a File as a String using the default character encoding.
static String toString(File file, String encoding)
          Get the contents of a File as a String using the specified character encoding.
static String toString(StreamSource src)
          Convert the input from the provided Reader into a String.
static String toString(StreamSource src, String ecoding)
          Convert the input from the provided Reader into a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextReader

public TextReader()
Method Detail

toString

public static String toString(File file,
                              String encoding)
Get the contents of a File as a String using the specified character encoding.

Parameters:
file - File to read from
encoding - IANA encoding
Returns:
a String containig the content of the File or null if an error happens.

toString

public static String toString(File file)
Get the contents of a File as a String using the default character encoding.

Parameters:
file - File to read from
Returns:
a String containig the content of the File or null if an error happens.

toString

public static String toString(StreamSource src,
                              String ecoding)
                       throws IOException
Convert the input from the provided Reader into a String.

Parameters:
inputStream - the Reader to copy from.
Returns:
a String that contains the content of the provided Reader.
Throws:
IOException - in case something bad happens.

toString

public static String toString(StreamSource src)
                       throws IOException
Convert the input from the provided Reader into a String.

Parameters:
inputStream - the Reader to copy from.
Returns:
a String that contains the content of the provided Reader.
Throws:
IOException - in case something bad happens.


Copyright © 2011-2012 GeoSolutions. All Rights Reserved.