org.encog.util.file
Class Directory

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

public final class Directory
extends Object

Directory utilities.

Author:
jheaton

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

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

deleteDirectory

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

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

readStream

public static String readStream(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 String readTextFile(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.


Copyright © 2014. All Rights Reserved.