|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jext.dawn.io.FileManager
Manages the files for the whole IO package.
This class provides functions to open/close files and
also to read/write into them. Each opened file is stored
as a property in DawnParser. Each file is
designed by a given ID.
| Field Summary | |
static java.lang.String |
NEW_LINE
Default line separator (system's one) used by the file manager. |
| Constructor Summary | |
FileManager()
|
|
| Method Summary | |
static void |
closeFile(java.lang.String ID,
Function function,
DawnParser parser)
Closes a given file. |
static boolean |
isFileAvailable(java.lang.String ID,
DawnParser parser)
Checks if a given file is still available or not. |
static void |
openFileForInput(java.lang.String ID,
java.lang.String file,
Function function,
DawnParser parser)
Opens a file for input (i.e to read from it). |
static void |
openFileForOutput(java.lang.String ID,
java.lang.String file,
Function function,
DawnParser parser)
Opens a file for output (i.e to write into it). |
static java.lang.String |
read(boolean line,
java.lang.String ID,
Function function,
DawnParser parser)
Reads from a file according to the line parameter.. |
static java.lang.String |
read(java.lang.String ID,
Function function,
DawnParser parser)
Reads a character from a given file. |
static java.lang.String |
readLine(java.lang.String ID,
Function function,
DawnParser parser)
Reads a line from a given file. |
static void |
write(boolean isLine,
java.lang.String ID,
java.lang.String line,
Function function,
DawnParser parser)
Writes a line into a given file. |
static void |
write(java.lang.String ID,
java.lang.String line,
Function function,
DawnParser parser)
Writes a line into a given file (does not add a return char). |
static void |
writeLine(java.lang.String ID,
java.lang.String line,
Function function,
DawnParser parser)
Writes a line into a given file (write the text then adds a return char). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String NEW_LINE
| Constructor Detail |
public FileManager()
| Method Detail |
public static void openFileForInput(java.lang.String ID,
java.lang.String file,
Function function,
DawnParser parser)
throws DawnRuntimeException
ID - The file internal IDfile - The path, relative or absolute, to the file to be openedfunction - The Function which is opening the fileparser - The DawnParser which is executing the above function
DawnRuntimeException
public static void openFileForOutput(java.lang.String ID,
java.lang.String file,
Function function,
DawnParser parser)
throws DawnRuntimeException
ID - The file internal IDfile - The path, relative or absolute, to the file to be opened/createdfunction - The Function which is opening the fileparser - The DawnParser which is executing the above function
DawnRuntimeException
public static java.lang.String readLine(java.lang.String ID,
Function function,
DawnParser parser)
throws DawnRuntimeException
ID - The file internal IDfunction - The Function which is opening the fileparser - The DawnParser which is executing the above function
DawnRuntimeException
public static java.lang.String read(java.lang.String ID,
Function function,
DawnParser parser)
throws DawnRuntimeException
ID - The file internal IDfunction - The Function which is opening the fileparser - The DawnParser which is executing the above function
DawnRuntimeException
public static java.lang.String read(boolean line,
java.lang.String ID,
Function function,
DawnParser parser)
throws DawnRuntimeException
line parameter..
line - If true, a whole line is read. Otherwise, only a char is read.ID - The file internal IDfunction - The Function which is opening the fileparser - The DawnParser which is executing the above function
DawnRuntimeException
public static void writeLine(java.lang.String ID,
java.lang.String line,
Function function,
DawnParser parser)
throws DawnRuntimeException
ID - The file internal IDline - The line to be writtenfunction - The Function which is opening the fileparser - The DawnParser which is executing the above function
DawnRuntimeException
public static void write(java.lang.String ID,
java.lang.String line,
Function function,
DawnParser parser)
throws DawnRuntimeException
ID - The file internal IDline - The line to be writtenfunction - The Function which is opening the fileparser - The DawnParser which is executing the above function
DawnRuntimeException
public static void write(boolean isLine,
java.lang.String ID,
java.lang.String line,
Function function,
DawnParser parser)
throws DawnRuntimeException
isLine parameter.
isLine - If true, the NEW_LINE value is added to the lineID - The file internal IDline - The line to be writtenfunction - The Function which is opening the fileparser - The DawnParser which is executing the above function
DawnRuntimeException
public static void closeFile(java.lang.String ID,
Function function,
DawnParser parser)
throws DawnRuntimeException
ID - The file internal IDfunction - The Function which is opening the fileparser - The DawnParser which is executing the above function
DawnRuntimeException
public static boolean isFileAvailable(java.lang.String ID,
DawnParser parser)
ID - The file internal IDparser - The DawnParser which is executing the above function
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||