public class BinaryUploadRequest extends HttpUploadRequest<BinaryUploadRequest>
Constructor and Description |
---|
BinaryUploadRequest(Context context,
String serverUrl)
Creates a new binaryupload request and automatically generates an upload id, that will
be returned when you call
UploadRequest.startUpload() . |
BinaryUploadRequest(Context context,
String uploadId,
String serverUrl)
Creates a binary file upload request.
|
Modifier and Type | Method and Description |
---|---|
BinaryUploadRequest |
addArrayParameter(String paramName,
List<String> list)
Adds a parameter with multiple values to this upload request.
|
BinaryUploadRequest |
addArrayParameter(String paramName,
String... array)
Adds a parameter with multiple values to this upload request.
|
BinaryUploadRequest |
addParameter(String paramName,
String paramValue)
Adds a parameter to this upload request.
|
BinaryUploadRequest |
setFileToUpload(String path)
Sets the file used as raw body of the upload request.
|
String |
startUpload()
Start the background file upload service.
|
addHeader, setBasicAuth, setCustomUserAgent, setMethod, setUsesFixedLengthStreamingMode
setAutoDeleteFilesAfterSuccessfulUpload, setDelegate, setMaxRetries, setNotificationConfig
public BinaryUploadRequest(Context context, String uploadId, String serverUrl) throws IllegalArgumentException, MalformedURLException
context
- application contextuploadId
- unique ID to assign to this upload request.UploadServiceBroadcastReceiver
,
you know to which upload they refer to.serverUrl
- URL of the server side script that will handle the multipart form upload.
E.g.: http://www.yourcompany.com/your/scriptIllegalArgumentException
- if one or more arguments are not validMalformedURLException
- if the server URL is not validpublic BinaryUploadRequest(Context context, String serverUrl) throws MalformedURLException, IllegalArgumentException
UploadRequest.startUpload()
.context
- application contextserverUrl
- URL of the server side script that will handle the multipart form upload.
E.g.: http://www.yourcompany.com/your/scriptIllegalArgumentException
- if one or more arguments are not validMalformedURLException
- if the server URL is not validpublic BinaryUploadRequest setFileToUpload(String path) throws FileNotFoundException
path
- path to the file that you want to uploadBinaryUploadRequest
FileNotFoundException
- if the file to upload does not existpublic BinaryUploadRequest addParameter(String paramName, String paramValue)
HttpUploadRequest
addParameter
in class HttpUploadRequest<BinaryUploadRequest>
paramName
- parameter nameparamValue
- parameter valuepublic BinaryUploadRequest addArrayParameter(String paramName, String... array)
HttpUploadRequest
addArrayParameter
in class HttpUploadRequest<BinaryUploadRequest>
paramName
- parameter namearray
- valuespublic BinaryUploadRequest addArrayParameter(String paramName, List<String> list)
HttpUploadRequest
addArrayParameter
in class HttpUploadRequest<BinaryUploadRequest>
paramName
- parameter namelist
- valuespublic String startUpload()
UploadRequest
startUpload
in class UploadRequest<BinaryUploadRequest>