Top Description Fields Constructors Methods
org.jboss.logmanager.handlers

public Class FileHandler

extends OutputStreamHandler
Class Inheritance
Known Direct Subclasses
org.jboss.logmanager.handlers.PeriodicRotatingFileHandler, org.jboss.logmanager.handlers.SizeRotatingFileHandler
Imports
java.io.BufferedOutputStream, .File, .FileNotFoundException, .FileOutputStream, .OutputStream, java.util.logging.Formatter

A simple file handler.

Field Summary

Modifier and TypeField and Description
private boolean
private File

Constructor Summary

AccessConstructor and Description
public
FileHandler()

Construct a new instance with no formatter and no output file.

public
FileHandler(final Formatter
the formatter
formatter
)

Construct a new instance with the given formatter and no output file.

public
FileHandler(final Formatter
the formatter
formatter
,
final File
the file
file
)

Construct a new instance with the given formatter and output file.

public
FileHandler(final Formatter
the formatter
formatter
,
final File
the file
file
,
final boolean
true to append, false to overwrite
append
)

Construct a new instance with the given formatter, output file, and append setting.

public
FileHandler(final File
the file
file
)

Construct a new instance with the given output file.

public
FileHandler(final File
the file
file
,
final boolean
true to append, false to overwrite
append
)

Construct a new instance with the given output file and append setting.

public
FileHandler(final String
the file name
fileName
)

Construct a new instance with the given output file.

public
FileHandler(final String
the file name
fileName
,
final boolean
true to append, false to overwrite
append
)

Construct a new instance with the given output file and append setting.

Method Summary

Modifier and TypeMethod and Description
public File

Returns:

the file
getFile
()

Get the current output file.

public void
setAppend(final boolean
true to append, false to overwrite
append
)

Specify whether to append to the target file.

public void
setFile(File
the file
file
)

Set the output file.

public void
setFileName(String
the file name
fileName
)

Set the output file by name.

Inherited from org.jboss.logmanager.handlers.OutputStreamHandler:
getOutputStreamsetCharsetPrivatesetOutputStreamsetWriter

Field Detail

appendback to summary
private boolean append
fileback to summary
private File file

Constructor Detail

FileHandlerback to summary
public FileHandler()

Construct a new instance with no formatter and no output file.

FileHandlerback to summary
public FileHandler(final Formatter formatter)

Construct a new instance with the given formatter and no output file.

Parameters
formatter:Formatter

the formatter

FileHandlerback to summary
public FileHandler(final Formatter formatter, final File file) throws FileNotFoundException

Construct a new instance with the given formatter and output file.

Parameters
formatter:Formatter

the formatter

file:File

the file

Exceptions
FileNotFoundException:
if the file could not be found on open
FileHandlerback to summary
public FileHandler(final Formatter formatter, final File file, final boolean append) throws FileNotFoundException

Construct a new instance with the given formatter, output file, and append setting.

Parameters
formatter:Formatter

the formatter

file:File

the file

append:boolean

true to append, false to overwrite

Exceptions
FileNotFoundException:
if the file could not be found on open
FileHandlerback to summary
public FileHandler(final File file) throws FileNotFoundException

Construct a new instance with the given output file.

Parameters
file:File

the file

Exceptions
FileNotFoundException:
if the file could not be found on open
FileHandlerback to summary
public FileHandler(final File file, final boolean append) throws FileNotFoundException

Construct a new instance with the given output file and append setting.

Parameters
file:File

the file

append:boolean

true to append, false to overwrite

Exceptions
FileNotFoundException:
if the file could not be found on open
FileHandlerback to summary
public FileHandler(final String fileName) throws FileNotFoundException

Construct a new instance with the given output file.

Parameters
fileName:String

the file name

Exceptions
FileNotFoundException:
if the file could not be found on open
FileHandlerback to summary
public FileHandler(final String fileName, final boolean append) throws FileNotFoundException

Construct a new instance with the given output file and append setting.

Parameters
fileName:String

the file name

append:boolean

true to append, false to overwrite

Exceptions
FileNotFoundException:
if the file could not be found on open

Method Detail

getFileback to summary
public File getFile()

Get the current output file.

Returns:File

the file

setAppendback to summary
public void setAppend(final boolean append)

Specify whether to append to the target file.

Parameters
append:boolean

true to append, false to overwrite

setFileback to summary
public void setFile(File file) throws FileNotFoundException

Set the output file.

Parameters
file:File

the file

Exceptions
FileNotFoundException:
if an error occurs opening the file
setFileNameback to summary
public void setFileName(String fileName) throws FileNotFoundException

Set the output file by name.

Parameters
fileName:String

the file name

Exceptions
FileNotFoundException:
if an error occurs opening the file