edu.jhu.tmaj.util
Class FileUtil

java.lang.Object
  extended by edu.jhu.tmaj.util.FileUtil

public final class FileUtil
extends java.lang.Object


Method Summary
static void copyFile(java.io.File sourceFile, java.io.File destinationFile)
           
static java.util.List<java.lang.String> readFileAsList(java.io.File file)
          Returns a List of Strings from the given file name.
static void renameFile(java.io.File file, java.lang.String newFileName)
          Renames a file.
static void writeFileAsList(java.io.File file, java.util.List<java.lang.String> stringsList)
          Writes a List of Strings to a specified filename
static void writeTabDelimitedFile(java.io.File file, java.util.List<java.util.List> linesList)
          Writes a list of lists to a file in tab-delimited format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

writeTabDelimitedFile

public static void writeTabDelimitedFile(java.io.File file,
                                         java.util.List<java.util.List> linesList)
                                  throws java.io.IOException
Writes a list of lists to a file in tab-delimited format. The main set of lists are rows and the sub-lists are cells in the row, each delimited with a tab.

Throws:
java.io.IOException

writeFileAsList

public static void writeFileAsList(java.io.File file,
                                   java.util.List<java.lang.String> stringsList)
                            throws java.io.IOException
Writes a List of Strings to a specified filename

Throws:
java.io.IOException

readFileAsList

public static java.util.List<java.lang.String> readFileAsList(java.io.File file)
                                                       throws java.io.IOException
Returns a List of Strings from the given file name. Each of the Strings represents one line in the file

Throws:
java.io.IOException

renameFile

public static void renameFile(java.io.File file,
                              java.lang.String newFileName)
                       throws java.io.IOException
Renames a file. A RuntimeException is thrown if unsuccessful.

Throws:
java.io.IOException

copyFile

public static void copyFile(java.io.File sourceFile,
                            java.io.File destinationFile)
                     throws java.io.IOException
Throws:
java.io.IOException