Class IOUtil

java.lang.Object
org.mockito.internal.util.io.IOUtil

public final class IOUtil extends Object
IO utils. A bit of reinventing the wheel but we don't want extra dependencies at this stage and we want to be java.
  • Constructor Details

    • IOUtil

      private IOUtil()
  • Method Details

    • writeText

      public static void writeText(String text, File output)
      Writes text to file
    • readLines

      public static Collection<String> readLines(InputStream is)
    • closeQuietly

      public static void closeQuietly(Closeable closeable)
      Closes the target. Does nothing when target is null. Is silent.
      Parameters:
      closeable - the target, may be null
    • close

      public static void close(Closeable closeable)
      Closes the target. Does nothing when target is null. Is not silent and exceptions are rethrown.
      Parameters:
      closeable - the target, may be null