The Encog Project

org.encog.util.file
Class Directory

java.lang.Object
  extended by org.encog.util.file.Directory

public final class Directory
extends java.lang.Object

Directory utilities.

Author:
jheaton

Field Summary
static int BUFFER_SIZE
          Default buffer size for read/write operations.
 
Method Summary
static void copyFile(java.io.File source, java.io.File target)
          Copy the specified file.
static boolean deleteDirectory(java.io.File path)
          Delete a directory and all children.
static java.lang.String readStream(java.io.InputStream is)
          Read the entire contents of a stream into a string.
static java.lang.String readTextFile(java.lang.String filename)
          Read the entire contents of a stream into a string.
 
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
Default buffer size for read/write operations.

See Also:
Constant Field Values
Method Detail

copyFile

public static void copyFile(java.io.File source,
                            java.io.File target)
Copy the specified file.

Parameters:
source - The file to copy.
target - The target of the copy.

deleteDirectory

public static boolean deleteDirectory(java.io.File path)
Delete a directory and all children.

Parameters:
path - The path to delete.
Returns:
True if successful.

readStream

public static java.lang.String readStream(java.io.InputStream is)
Read the entire contents of a stream into a string.

Parameters:
is - The input stream to read from.
Returns:
The string that was read in.

readTextFile

public static java.lang.String readTextFile(java.lang.String filename)
Read the entire contents of a stream into a string.

Parameters:
filename - The input stream to read from.
Returns:
The string that was read in.

The Encog Project