org.pentaho.platform.util
Class FileHelper
java.lang.Object
org.pentaho.platform.util.FileHelper
public class FileHelper
- extends Object
FileHelper
public FileHelper()
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