be.lassi.util
Class Contents
java.lang.Object
be.lassi.util.Contents
public class Contents
- extends java.lang.Object
Helper class for reading and writing the contents of file with given name as
one string.
Constructor Summary |
Contents(java.lang.String filename)
Constructs new instance. |
Method Summary |
java.lang.String |
getString()
Gets the entire contents of the file in one string. |
void |
write(java.lang.String string)
Writes given string to file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Contents
public Contents(java.lang.String filename)
- Constructs new instance.
- Parameters:
fileName
- name of the file to be read or written
getString
public java.lang.String getString()
throws java.io.IOException
- Gets the entire contents of the file in one string.
- Returns:
- the file contents
- Throws:
java.io.IOException
- if problem
write
public void write(java.lang.String string)
throws java.io.IOException
- Writes given string to file.
- Parameters:
string
- the string to be written
- Throws:
java.io.IOException
- if problem