public class FileChannel extends LogChannel implements java.lang.AutoCloseable
| Constructor and Description |
|---|
FileChannel(java.lang.String theFilePath,
int theMaxSize,
int theBackupNumber)
Create a new instance of FileChannel.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Cleanup any open channels.
|
protected void |
createLogChannel()
Create the file channel.
|
void |
resetChannel(int theMaxSize,
int theBackupNumber)
Reset the FileChannel's file size and number of backups.
|
void |
writeError(java.lang.String message)
Write an exception to the file channel.
|
void |
writeMessage(java.lang.String message)
Write the message to the file channel.
|
public FileChannel(java.lang.String theFilePath,
int theMaxSize,
int theBackupNumber)
throws java.lang.Exception
theFilePath - the path of the file to create.theMaxSize - the maximum allowed size of the file.theBackupNumber - the maximum number of previous files to keep.java.lang.Exception - any error.public void resetChannel(int theMaxSize,
int theBackupNumber)
theMaxSize - the maximum allowed size of the file.theBackupNumber - the maximum number of previous files to keep.protected void createLogChannel()
throws java.lang.Exception
createLogChannel in class LogChanneljava.lang.Exception - any error.public void writeMessage(java.lang.String message)
throws java.lang.Exception
writeMessage in class LogChannelmessage - the message to write.java.lang.Exception - any error.public void writeError(java.lang.String message)
throws java.lang.Exception
writeError in class LogChannelmessage - the message to write.java.lang.Exception - any error.public void close()
close in interface java.lang.AutoCloseable