Class ProgressReportingRequestBody.MultiPartBuilder
java.lang.Object
com.amilesend.client.connection.file.ProgressReportingRequestBody.MultiPartBuilder
- Enclosing class:
ProgressReportingRequestBody
The builder used to construct new
ProgressReportingRequestBody
instances for multipart uploads.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newRequestBody
that 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 attribute field name for the form data in the request.The file to upload.
-
Method Details
-
file
The file to upload.- Parameters:
file
- the path of the file to upload- Returns:
- the builder
-
fieldName
The attribute field name for the form data in the request. Default isupload
.- Parameters:
fieldName
- the field name- 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 newRequestBody
that 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
-