Class FileWriterBuilder
java.lang.Object
org.apache.juneau.commons.internal.FileWriterBuilder
Utility class for creating
FileWriter objects.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappend()Sets the append mode on the writer totrue .buffered()Sets the buffer mode on the writer totrue .build()Creates a new File writer.Sets the character encoding of the file.Sets the character encoding of the file.static FileWriterBuildercreate()Creates a new builder.static FileWriterBuilderCreates a new builder initialized with the specified file.static FileWriterBuilderCreates a new builder initialized with the specified file path.Sets the file being written to.Sets the path of the file being written to.
-
Constructor Details
-
FileWriterBuilder
public FileWriterBuilder()
-
-
Method Details
-
create
Creates a new builder.- Returns:
- A new builder.
-
create
Creates a new builder initialized with the specified file.- Parameters:
file- The file being written to.- Returns:
- A new builder.
-
create
Creates a new builder initialized with the specified file path.- Parameters:
path- The file path being written to.- Returns:
- A new builder.
-
file
Sets the file being written to.- Parameters:
file- The file being written to.- Returns:
- This object.
-
file
Sets the path of the file being written to.- Parameters:
path- The path of the file being written to.- Returns:
- This object.
-
charset
Sets the character encoding of the file.- Parameters:
cs- The character encoding. The default isCharset.defaultCharset().- Returns:
- This object.
-
charset
Sets the character encoding of the file.- Parameters:
cs- The character encoding. The default isCharset.defaultCharset().- Returns:
- This object.
-
append
Sets the append mode on the writer totrue .- Returns:
- This object.
-
buffered
Sets the buffer mode on the writer totrue .- Returns:
- This object.
-
build
Creates a new File writer.- Returns:
- A new File writer.
- Throws:
FileNotFoundException- If file could not be found.
-