Package org.eclipse.jetty.toolchain.test
Class IO
java.lang.Object
org.eclipse.jetty.toolchain.test.IO
IO Utilities.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated, for removal: This API element is subject to removal in a future version. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcloses anCloseable, and silently ignores exceptionsstatic voidDeprecated, for removal: This API element is subject to removal in a future version.static voidcopy(InputStream in, OutputStream out) Copy the entireInputStreamto theOutputStreamstatic voidCopy Reader to Writer out until EOF or exception.static voidCopy files or directories.static voidDeprecated, for removal: This API element is subject to removal in a future version.usecopyDir(Path, Path)insteadstatic voidCopy the contents of a directory from one directory to another.static voidDeprecated.useFiles.copy(Path, Path, CopyOption...)insteadstatic voidCopy a file from one place to another usingFiles.copy(Path, Path, CopyOption...)static StringreadToString(File file) Deprecated, for removal: This API element is subject to removal in a future version.useFiles.readString(Path, Charset)insteadstatic StringreadToString(Path path) Deprecated, for removal: This API element is subject to removal in a future version.useFiles.readString(Path, Charset)instead
-
Field Details
-
BUFFER_SIZE
public static final int BUFFER_SIZE- See Also:
-
-
Constructor Details
-
IO
private IO()
-
-
Method Details
-
copy
Copy Reader to Writer out until EOF or exception.- Parameters:
in- the Reader to read fromout- the Writer to write to- Throws:
IOException- if unable to copy the contents
-
copy
Copy the entireInputStreamto theOutputStream- Parameters:
in- the input stream to read fromout- the output stream to write to- Throws:
IOException- if unable to copy the stream
-
close
closes anCloseable, and silently ignores exceptions- Parameters:
c- the closeable to close
-
copy
Copy files or directories.- Parameters:
src- the from pathdest- the destination path- Throws:
IOException- if unable to copy the file
-
copyDir
Copy the contents of a directory from one directory to another.- Parameters:
srcDir- the from directorydestDir- the destination directory- Throws:
IOException- if unable to copy the file
-
copyFile
Copy a file from one place to another usingFiles.copy(Path, Path, CopyOption...)- Parameters:
srcFile- the file to copydestFile- 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.useFiles.readString(Path, Charset)instead- 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.useFiles.readString(Path, Charset)insteadRead 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.usecopy(Path, Path)insteadCopy files or directories.- Parameters:
src- the from pathdest- 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.usecopyDir(Path, Path)insteadCopy the contents of a directory from one directory to another.- Parameters:
srcDir- the from directorydestDir- the destination directory- Throws:
IOException- if unable to copy the file
-
copyFile
Deprecated.useFiles.copy(Path, Path, CopyOption...)insteadCopy a file from one place to another- Parameters:
srcFile- the file to copydestFile- the destination file to create- Throws:
IOException- if unable to copy the file
-
copy(Path, Path)instead