Class IoUtil

  • public class IoUtil
    extends java.lang.Object
    Tom Baeyens, Frederik Heremans, Joram Barrez
    • Constructor Summary

      Constructor Description
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void closeSilently​( closeable)
      Closes the given stream.
      static void flushSilently​( flushable)
      Flushes the given object.
      static getFile​(java.lang.String filePath)  
      static java.lang.String readClasspathResourceAsString​(java.lang.String resourceName)  
      static byte[] readInputStream​( inputStream, java.lang.String inputStreamName)  
      static void writeStringToFile​(java.lang.String content, java.lang.String filePath)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IoUtil

        public IoUtil()
    • Method Detail

      • readInputStream

        public static byte[] readInputStream​( inputStream,
                                             java.lang.String inputStreamName)
      • readClasspathResourceAsString

        public static java.lang.String readClasspathResourceAsString​(java.lang.String resourceName)
      • getFile

        public static getFile​(java.lang.String filePath)
      • writeStringToFile

        public static void writeStringToFile​(java.lang.String content,
                                             java.lang.String filePath)
      • closeSilently

        public static void closeSilently​( closeable)
        Closes the given stream. The same as calling Closeable.close(), but errors while closing are silently ignored.
      • flushSilently

        public static void flushSilently​( flushable)
        Flushes the given object. The same as calling Flushable.flush(), but errors while flushing are silently ignored.