Package com.teamdev.jxbrowser.net
Class File.Builder
java.lang.Object
com.teamdev.jxbrowser.net.File.Builder
- Enclosing interface:
- File
A builder of
File
.
Builders are created by invoking File.newBuilder()
.
Each of the setter methods modifies the state of the builder and returns the same instance.
Builders are not thread-safe and should not be used concurrently from multiple threads
without external synchronization.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns a newFile
instance built from the current state of this builder.bytesValue
(byte[] bytes) Sets the byte sequence representing the file upload data segment.contentType
(String contentType) Sets the file content type determined by the file extension.Sets the file path.
-
Method Details
-
name
-
contentType
Sets the file content type determined by the file extension.- Parameters:
contentType
- the file content type determined by the file extension- Returns:
- this builder
-
pathValue
Sets the file path.- Parameters:
path
- the file path- Returns:
- this builder
-
bytesValue
Sets the byte sequence representing the file upload data segment.- Parameters:
bytes
- the byte sequence representing the file upload data segment- Returns:
- this builder
-
build
Returns a newFile
instance built from the current state of this builder.- Returns:
- a new
File
instance
-