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 class
AFileFilter
for obtaining a list of contents that does not contain the special.
and..
entries that some JVM environments report. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
closes anCloseable
, and silently ignores exceptionsstatic void
Copy files or directories.static void
copy
(InputStream in, OutputStream out) Copy the entireInputStream
to theOutputStream
static void
Copy Reader to Writer out until EOF or exception.static void
Copy the contents of a directory from one directory to another.static void
Copy a file from one place to anotherstatic String
readToString
(File file) Read the contents of a file into a String and return it.
-
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
-
readToString
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.
-
close
closes anCloseable
, and silently ignores exceptions- Parameters:
c
- the closeable to close
-
copy
Copy files or directories.- Parameters:
from
- the from pathto
- the destination path- Throws:
IOException
- if unable to copy the file
-
copyDir
Copy the contents of a directory from one directory to another.- Parameters:
from
- the from directoryto
- the destination directory- Throws:
IOException
- if unable to copy the file
-
copy
Copy the entireInputStream
to theOutputStream
- Parameters:
in
- the input stream to read fromout
- the output stream to write to- Throws:
IOException
- if unable to copy the stream
-
copyFile
Copy a file from one place to another- Parameters:
from
- the file to copyto
- the destination file to create- Throws:
IOException
- if unable to copy the file
-