|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ProGAL.io.IOToolbox
public abstract class IOToolbox
A wrapper class for static file input/output methods. All of the methods have a policy of not throwing IOExceptions (and similar) if an error occurs. Instead they throw RuntimeExceptions such that try-catch-statements can be excluded if desired. All methods (TODO: Only implemented for writeToFile and readFromFile) supports reading (writing) from (to) gzipped files. This feature is implicitly activated when the specified file name ends with '.gz'.
Constructor Summary | |
---|---|
IOToolbox()
|
Method Summary | |
---|---|
static java.lang.String |
readFromFile(java.lang.String fName)
Read the contents of the specified file and return it in a string. |
static java.lang.String |
readFromInternalFile(java.lang.String fName)
Read the contents of the specified file and return it in a string. |
static java.lang.Object |
readSerializedFile(java.lang.String fName)
Reads a serialized object from the specified file-name. |
static void |
writeSerializedFile(java.io.Serializable obj,
java.lang.String fName)
Writes a serialized object to the specified file-name. |
static void |
writeToFile(java.lang.String contents,
java.lang.String fileName,
boolean append)
Writes a string to the specified file-name. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IOToolbox()
Method Detail |
---|
public static void writeToFile(java.lang.String contents, java.lang.String fileName, boolean append)
public static java.lang.String readFromFile(java.lang.String fName)
public static java.lang.String readFromInternalFile(java.lang.String fName) throws java.lang.Error
java.lang.Error
public static void writeSerializedFile(java.io.Serializable obj, java.lang.String fName)
public static java.lang.Object readSerializedFile(java.lang.String fName)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |