public class FileTarget extends StreamTarget
| Modifier and Type | Field and Description |
|---|---|
private boolean |
m_append |
private java.io.File |
m_file |
| Constructor and Description |
|---|
FileTarget(java.io.File file,
boolean append,
Formatter formatter)
Construct file target to write to a file with a formatter.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.io.File |
getFile()
Retrieve file associated with target.
|
protected void |
openFile()
Open underlying file and allocate resources.
|
protected void |
setFile(java.io.File file,
boolean append)
Set the file for this target.
|
close, setOutputStream, shutdownStream, writedoProcessEvent, getFormatter, opengetErrorHandler, isOpen, processEvent, setErrorHandlerpublic FileTarget(java.io.File file,
boolean append,
Formatter formatter)
throws java.io.IOException
file - the file to write toappend - true if file is to be appended to, false otherwiseformatter - the Formatterjava.io.IOException - if an error occursprotected void setFile(java.io.File file,
boolean append)
throws java.io.IOException
file - the file to write toappend - true if file is to be appended to, false otherwisejava.io.IOException - if directories can not be created or file can not be openedprotected void openFile()
throws java.io.IOException
java.io.IOException - if directories can not be created or file can not be openedprotected java.io.File getFile()