java.lang.Object
org.eclipse.jetty.toolchain.test.IO

public final class IO extends Object
IO Utilities.
  • Field Details

  • Constructor Details

    • IO

      private IO()
  • Method Details

    • copy

      public static void copy(Reader in, Writer out) throws IOException
      Copy Reader to Writer out until EOF or exception.
      Parameters:
      in - the Reader to read from
      out - the Writer to write to
      Throws:
      IOException - if unable to copy the contents
    • copy

      public static void copy(InputStream in, OutputStream out) throws IOException
      Copy the entire InputStream to the OutputStream
      Parameters:
      in - the input stream to read from
      out - the output stream to write to
      Throws:
      IOException - if unable to copy the stream
    • close

      public static void close(Closeable c)
      closes an Closeable, and silently ignores exceptions
      Parameters:
      c - the closeable to close
    • copy

      public static void copy(Path src, Path dest) throws IOException
      Copy files or directories.
      Parameters:
      src - the from path
      dest - the destination path
      Throws:
      IOException - if unable to copy the file
    • copyDir

      public static void copyDir(Path srcDir, Path destDir) throws IOException
      Copy the contents of a directory from one directory to another.
      Parameters:
      srcDir - the from directory
      destDir - the destination directory
      Throws:
      IOException - if unable to copy the file
    • copyFile

      public static void copyFile(Path srcFile, Path destFile) throws IOException
      Copy a file from one place to another using Files.copy(Path, Path, CopyOption...)
      Parameters:
      srcFile - the file to copy
      destFile - the destination file to create
      Throws:
      IOException - if unable to copy the file
    • readToString

      @Deprecated(forRemoval=true, since="6.0") public static String readToString(Path path) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      IOException
    • readToString

      @Deprecated(forRemoval=true, since="6.0") public static String readToString(File file) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Read the contents of a file into a String and return it.
      Parameters:
      file - the file to read.
      Returns:
      the contents of the file.
      Throws:
      IOException - if unable to read the file.
    • copy

      @Deprecated(forRemoval=true, since="6.0") public static void copy(File src, File dest) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      use copy(Path, Path) instead
      Copy files or directories.
      Parameters:
      src - the from path
      dest - the destination path
      Throws:
      IOException - if unable to copy the file
    • copyDir

      @Deprecated(forRemoval=true, since="6.0") public static void copyDir(File srcDir, File destDir) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Copy the contents of a directory from one directory to another.
      Parameters:
      srcDir - the from directory
      destDir - the destination directory
      Throws:
      IOException - if unable to copy the file
    • copyFile

      @Deprecated public static void copyFile(File srcFile, File destFile) throws IOException
      Deprecated.
      Copy a file from one place to another
      Parameters:
      srcFile - the file to copy
      destFile - the destination file to create
      Throws:
      IOException - if unable to copy the file