public class FileManagement
extends java.lang.Object
Constructor and Description |
---|
FileManagement()
Creates a new instance of FileManagement
|
Modifier and Type | Method and Description |
---|---|
void |
closeRead()
Close the file we've read.
|
void |
closeWrite()
Close the file we've writen.
|
int |
fin()
Indicates if we've achieved to the end of file.
|
void |
initRead(java.lang.String _name)
Init a file for reading.
|
void |
initWrite(java.lang.String _name)
Init a file for reading.
|
java.lang.String |
readAllFile()
Reads a whole file
|
char |
readChar()
Reades a char from file.
|
java.lang.String |
readLine()
Reads a line from the file.
|
void |
writeChar(char _c)
Writes a char from file.
|
void |
writeLine(java.lang.String _line)
Write a line given.
|
public void initRead(java.lang.String _name) throws java.lang.Exception
_name
- path+name of file to read.java.lang.Exception
- if the file does not exist or can not be read or written.public void initWrite(java.lang.String _name) throws java.lang.Exception
_name
- path+name of file to read.java.lang.Exception
- if the file does not exist or can not be read or written.public char readChar() throws java.lang.Exception
java.lang.Exception
- if the file does not exist or can not be read or written.public void writeChar(char _c) throws java.lang.Exception
_c
- char to write.java.lang.Exception
- if the file does not exist or can not be read or written.public java.lang.String readLine() throws java.lang.Exception
java.lang.Exception
- if the file does not exist or can not be read or written.public void writeLine(java.lang.String _line) throws java.lang.Exception
_line
- line given.java.lang.Exception
- f the file does not exist or can not be read or written.public int fin() throws java.lang.Exception
java.lang.Exception
- if the file does not exist or can not be read or written.public void closeRead() throws java.lang.Exception
java.lang.Exception
- if the file does not exist or can not be read or written.public void closeWrite() throws java.lang.Exception
java.lang.Exception
- if the file does not exist or can not be read or written.public java.lang.String readAllFile()