org.pentaho.platform.util
Class FileHelper

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

public class FileHelper
extends Object


Constructor Summary
FileHelper()
           
 
Method Summary
static void closeInputStream(InputStream strm)
          Convenience method to close an input stream and handle (log and throw away) any exceptions.
static void closeReader(Reader rdr)
          Convenience method to close a Reader and handle (log and throw away) any exceptions.
static byte[] getBytesFromFile(File file)
           
static String getStringFromFile(File f)
           
static String getStringFromInputStream(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 String getStringFromInputStream(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 String getStringFromFile(File f)

getBytesFromFile

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

closeInputStream

public static void closeInputStream(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(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