de.uds.cs.st.dd.util
Class FileUtils

java.lang.Object
  |
  +--de.uds.cs.st.dd.util.FileUtils

public final class FileUtils
extends Object

File utilities for the dd plugin.

Author:
Philipp Bouillon

Field Summary
private static int BUFFER_SIZE
          Sets the size of the read buffer.
 
Constructor Summary
FileUtils()
           
 
Method Summary
static void copyFile(String sourceName, String destinationName)
          Copies a file.
static void copyResourceToFile(String resource, String fileName)
          Copies an internet resource.
static String readFile(File file)
          Reads the file that is specified by the parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUFFER_SIZE

private static final int BUFFER_SIZE
Sets the size of the read buffer.

See Also:
Constant Field Values
Constructor Detail

FileUtils

public FileUtils()
Method Detail

readFile

public static String readFile(File file)
                       throws IOException
Reads the file that is specified by the parameter. It returns a string that contains the whole file.

Parameters:
file - the file to be read.
Returns:
String the contents of the file.
Throws:
IOException - if any file system error occurs.

copyFile

public static void copyFile(String sourceName,
                            String destinationName)
                     throws IOException
Copies a file.

Parameters:
sourceName - name of the original file.
destinationName - name of the destination file.
Throws:
IOException - if any file system error occurs.

copyResourceToFile

public static void copyResourceToFile(String resource,
                                      String fileName)
                               throws IOException
Copies an internet resource.

Parameters:
resource - path to the original resource.
fileName - name of the destination file.
Throws:
IOException - if any file system error occurs.