org.pentaho.platform.util
Class FileHelper

java.lang.Object
  extended by org.pentaho.platform.util.FileHelper

public class FileHelper
extends java.lang.Object


Constructor Summary
FileHelper()
           
 
Method Summary
static void closeInputStream(java.io.InputStream strm)
          Convenience method to close an input stream and handle (log and throw away) any exceptions.
static void closeReader(java.io.Reader rdr)
          Convenience method to close a Reader and handle (log and throw away) any exceptions.
static byte[] getBytesFromFile(java.io.File file)
           
static java.lang.String getStringFromFile(java.io.File f)
           
static java.lang.String getStringFromInputStream(java.io.InputStream is)
          Note: wrap the InputStreamReader in a BufferedReader for efficiency.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileHelper

public FileHelper()
Method Detail

getStringFromInputStream

public static java.lang.String getStringFromInputStream(java.io.InputStream is)
Note: wrap the InputStreamReader in a BufferedReader for efficiency. See: http://java.sun.com/j2se/1.4.2/docs/api/java/io/InputStreamReader.html

Parameters:
is -
Returns:

getStringFromFile

public static java.lang.String getStringFromFile(java.io.File f)

getBytesFromFile

public static byte[] getBytesFromFile(java.io.File file)
                               throws java.io.IOException
Throws:
java.io.IOException

closeInputStream

public static void closeInputStream(java.io.InputStream strm)
Convenience method to close an input stream and handle (log and throw away) any exceptions. Helps keep code uncluttered.

Parameters:
strm - InputStream to be closed

closeReader

public static void closeReader(java.io.Reader rdr)
Convenience method to close a Reader and handle (log and throw away) any exceptions. Helps keep code uncluttered.

Parameters:
rdr - InputSReadertream to be closed