public class FileTarget extends StreamTarget
Constructor and Description |
---|
FileTarget(File file,
boolean append,
Formatter formatter)
Construct file target to write to a file with a formatter.
|
Modifier and Type | Method and Description |
---|---|
protected File |
getFile()
Retrieve file associated with target.
|
protected void |
openFile()
Open underlying file and allocate resources.
|
protected void |
setFile(File file,
boolean append)
Set the file for this target.
|
close, setOutputStream, shutdownStream, write
doProcessEvent, getFormatter, open
getErrorHandler, isOpen, processEvent, setErrorHandler
public FileTarget(File file, boolean append, Formatter formatter) throws IOException
file
- the file to write toappend
- true if file is to be appended to, false otherwiseformatter
- the FormatterIOException
- if an error occursprotected void setFile(File file, boolean append) throws IOException
file
- the file to write toappend
- true if file is to be appended to, false otherwiseIOException
- if directories can not be created or file can not be openedprotected void openFile() throws IOException
IOException
- if directories can not be created or file can not be openedprotected File getFile()
Copyright © 1997–2023. All rights reserved.