|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object text.TextFileIO
public class TextFileIO
TextFileIO Class receives the file name and either saves the file or reads the file.
Field Summary |
---|
Fields inherited from interface text.TextConstants |
---|
COMMA, CREATED_BY_ZYX, DELIM, DOUBLE_QUOTE, ELEMENT_DOCUMENT, ELEMENT_ITEM, EMPTY, FALSE, FORWARD_SLASH, FOUR_SPACES, ID_EQUALS, JAVA_LANG_STRING, LEFT_ANGLE, LEFT_BRACE, LEFT_BRACKET, MENU_ONE, MENU_TWO, NEW_LINE, ONE, RIGHT_ANGLE, RIGHT_BRACE, RIGHT_BRACKET, SEMICOLON, SINGLE_QUOTE, SPACE, TRUE, TWO, XML_VERSION, ZERO |
Constructor Summary | |
---|---|
TextFileIO()
|
Method Summary | |
---|---|
static java.lang.String |
getContent(java.lang.String filename)
This method opens a file and returns the file's content. |
static java.lang.String |
getDELIM()
Gets one empty space. |
private static java.lang.String |
readText(java.io.File textFile)
This method reads each line of the file assigns it to a temporary variable and then inserts an end line statement. |
static boolean |
saveContent(java.lang.String filename,
java.lang.String content)
This method calls saveText method and returns boolean variable representing success or failure of saving. |
static boolean |
saveText(java.lang.String filename,
java.lang.String content)
This method attempts to write a file to the disk. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextFileIO()
Method Detail |
---|
private static java.lang.String readText(java.io.File textFile) throws java.io.IOException
textFile
- is the file object to be read.
java.io.IOException
- - this exception is caught at the Business
Object layer to signal the I/O problem occurred.public static java.lang.String getDELIM()
public static java.lang.String getContent(java.lang.String filename) throws java.io.FileNotFoundException, java.io.IOException
filename
- is the name of the file to be opened.
java.io.FileNotFoundException
- - this exception is caught at the Business
Object layer to signal the file does not exist.
java.io.IOException
- - this exception is caught at the Business
Object layer to signal the I/O problem occurred.public static boolean saveContent(java.lang.String filename, java.lang.String content) throws java.io.FileNotFoundException, java.io.IOException
filename
- - the name of the file to be saved as.content
- - the string representation of the data to be saved.
java.io.FileNotFoundException
- - this exception is caught at the Business
Object layer to signal the file does not exist.
java.io.IOException
- - this exception is caught at the Business
Object layer to signal the I/O problem occurred.public static boolean saveText(java.lang.String filename, java.lang.String content) throws java.io.IOException
filename
- - the name of the file to be saved as.content
- - the string representation of the data to be saved.
java.io.IOException
- - this exception is caught at the Business
Object layer to signal the I/O problem occurred.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |