Package org.pentaho.platform.util
Class FileHelper
- java.lang.Object
-
- org.pentaho.platform.util.FileHelper
-
public class FileHelper extends Object
-
-
Constructor Summary
Constructors Constructor Description FileHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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.
-
-
-
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:
-
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
-
-