Class FileHelper


  • public class FileHelper
    extends Object
    • 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)
      • 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