ec.app.sequence
Class FileUtil
java.lang.Object
ec.app.sequence.FileUtil
public class FileUtil
- extends java.lang.Object
Method Summary |
static void |
close()
|
static void |
quickWrite(java.lang.String data)
|
static java.util.List |
readTextFileToStringList(java.io.File f,
boolean trimWhiteSpace)
Reads the lines of a text file. |
static void |
writeStringToTextFile(java.io.File f,
java.lang.String text,
boolean append)
Writes a string into a text file. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileUtil
public FileUtil()
quickWrite
public static void quickWrite(java.lang.String data)
throws java.lang.Exception
- Throws:
java.lang.Exception
close
public static void close()
throws java.lang.Exception
- Throws:
java.lang.Exception
writeStringToTextFile
public static void writeStringToTextFile(java.io.File f,
java.lang.String text,
boolean append)
throws java.io.IOException
- Writes a string into a text file.
- Parameters:
f
- the file to be writtentext
- the string to writeappend
- true
to append to an existing fileutf8
- writes the text to an UTF8 encoded file
- Throws:
java.io.IOException
readTextFileToStringList
public static java.util.List readTextFileToStringList(java.io.File f,
boolean trimWhiteSpace)
throws java.io.IOException
- Reads the lines of a text file.
- Parameters:
f
- the file to be readtrimWhiteSpace
- if true
, all white space in front and at the
end of a line will be romved, new line characters inclusive.utf8
- reads from an UTF8 encoded file
- Returns:
- a list of strings, one for each line
- Throws:
java.io.IOException