Class FileHandler
Inheritance
java.lang.Object
FileHandler
Syntax
Constructors
FileHandler(String fileName, String filePath)
Declaration
public FileHandler(String fileName, String filePath)
Parameters
| Type |
Name |
Description |
| String |
fileName |
Needs to have the name of the file with the file extension included
|
| String |
filePath |
The complete path to the file or relative ./
|
Exceptions
| Type |
Condition |
| IOException |
|
Fields
out
Declaration
Field Value
| Type |
Description |
| PrintWriter |
|
Methods
checkFileExists()
Declaration
public boolean checkFileExists()
Returns
destroy()
Declaration
finalize()
Declaration
getMaxLines()
Declaration
Returns
initializeReader()
Declaration
public synchronized void initializeReader()
Returns
| Type |
Description |
| synchronized void |
|
initializeWriter(boolean autoFlush)
setAppend Needs To Be Called Before Initializing Writer If The File Already Exists. Otherwise It Will Overwrite The End Of The File.
Declaration
public synchronized void initializeWriter(boolean autoFlush)
Parameters
| Type |
Name |
Description |
| boolean |
autoFlush |
|
Returns
| Type |
Description |
| synchronized void |
|
Exceptions
| Type |
Condition |
| IOException |
|
initializeWriter(boolean autoFlush, int maxLines)
setAppend Needs To Be Called Before Initializing Writer If The File Already Exists. Otherwise It Will Overwrite The End Of The File.
Declaration
public synchronized void initializeWriter(boolean autoFlush, int maxLines)
Parameters
| Type |
Name |
Description |
| boolean |
autoFlush |
|
| int |
maxLines |
|
Returns
| Type |
Description |
| synchronized void |
|
Exceptions
| Type |
Condition |
| IOException |
|
isAppend()
Declaration
public boolean isAppend()
Returns
readLine()
Declaration
Returns
setAppend(boolean append)
Declaration
public void setAppend(boolean append)
Parameters
| Type |
Name |
Description |
| boolean |
append |
|