Class FileReaderBuilder
java.lang.Object
org.apache.juneau.commons.internal.FileReaderBuilder
Utility class for creating
FileReader objects.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionIf called and the file isnull or non-existent, then thebuild()command will return an empty reader instead of aFileNotFoundException.build()Creates a new File reader.Sets the character encoding of the file.Sets the character encoding of the file.static FileReaderBuildercreate()Creates a new builder.static FileReaderBuilderCreates a new builder initialized with the specified file.Sets the file being written from.Sets the path of the file being written from.
-
Constructor Details
-
FileReaderBuilder
public FileReaderBuilder()
-
-
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.
-
file
Sets the file being written from.- Parameters:
file- The file being written from.- Returns:
- This object.
-
file
Sets the path of the file being written from.- Parameters:
path- The path of the file being written from.- 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.
-
allowNoFile
If called and the file isnull or non-existent, then thebuild()command will return an empty reader instead of aFileNotFoundException.- Returns:
- This object.
-
build
Creates a new File reader.- Returns:
- A new File reader.
- Throws:
FileNotFoundException- If file could not be found.
-