org.eclipse.jetty.toolchain.test
Class IO

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

public final class IO
extends Object

IO Utilities.


Nested Class Summary
static class IO.SafeFileFilter
           
 
Field Summary
static int BUFFER_SIZE
           
 
Method Summary
static void close(Closeable c)
          closes an Closeable, and silently ignores exceptions
static void copy(File from, File to)
          Copy files or directories
static void copy(InputStream in, OutputStream out)
           
static void copy(Reader in, Writer out)
          Copy Reader to Writer out until EOF or exception.
static void copyDir(File from, File to)
           
static void copyFile(File from, File to)
           
static String readToString(File file)
          Read the contents of a file into a String and return it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUFFER_SIZE

public static final int BUFFER_SIZE
See Also:
Constant Field Values
Method Detail

copy

public static void copy(Reader in,
                        Writer out)
                 throws IOException
Copy Reader to Writer out until EOF or exception.

Throws:
IOException

readToString

public static String readToString(File file)
                           throws IOException
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

public static void close(Closeable c)
closes an Closeable, and silently ignores exceptions

Parameters:
c - the closeable to close

copy

public static void copy(File from,
                        File to)
                 throws IOException
Copy files or directories

Parameters:
from -
to -
Throws:
IOException

copyDir

public static void copyDir(File from,
                           File to)
                    throws IOException
Throws:
IOException

copy

public static void copy(InputStream in,
                        OutputStream out)
                 throws IOException
Throws:
IOException

copyFile

public static void copyFile(File from,
                            File to)
                     throws IOException
Throws:
IOException


Copyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.