Class ProgressReportingRequestBody.Builder
java.lang.Object
com.amilesend.client.connection.file.ProgressReportingRequestBody.Builder
- Enclosing class:
ProgressReportingRequestBody
The builder used to construct new
ProgressReportingRequestBody instances for uploads.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newRequestBodythat tracks the transfer progress for multipart form-data transfer.callback(TransferProgressCallback callback) The callback listener.contentType(String contentType) The content type.destination(String destination) The destination descriptor (i.e., the name of the service).The file to upload.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
file
The file to upload.- Parameters:
file- the path of the file to upload- Returns:
- the builder
-
contentType
The content type. The default istext/csv.- Parameters:
contentType- the content type- Returns:
- the builder
-
destination
The destination descriptor (i.e., the name of the service).- Parameters:
destination- the destination- Returns:
- the builder
-
callback
The callback listener. Default is aLogProgressCallback.- Parameters:
callback- the listener- Returns:
- the builder
-
build
Builds a newRequestBodythat tracks the transfer progress for multipart form-data transfer.- Returns:
- the request body
- Throws:
IOException- if an error occurred while accessing the file to read
-