public abstract class UploadRequest extends Object
HttpUploadRequest
instead.Constructor and Description |
---|
UploadRequest(Context context,
String uploadId,
String serverUrl)
Creates a new upload request.
|
Modifier and Type | Method and Description |
---|---|
UploadRequest |
setAutoDeleteFilesAfterSuccessfulUpload(boolean autoDeleteFiles)
Sets the automatic file deletion after successful upload.
|
UploadRequest |
setDelegate(UploadStatusDelegate delegate)
Sets the delegate which will receive the events for this upload request.
|
UploadRequest |
setMaxRetries(int maxRetries)
Sets the maximum number of retries that the library will try if an error occurs,
before returning an error.
|
UploadRequest |
setNotificationConfig(UploadNotificationConfig config)
Sets custom notification configuration.
|
String |
startUpload()
Start the background file upload service.
|
public UploadRequest(Context context, String uploadId, String serverUrl)
context
- application contextuploadId
- unique ID to assign to this upload request. If is null or empty, a random
UUID will be automatically generated. It's used in the broadcast receiver
when receiving updates.serverUrl
- URL of the server side script that handles the requestpublic final String startUpload() throws IllegalArgumentException, MalformedURLException
IllegalArgumentException
- if one or more arguments passed are invalidMalformedURLException
- if the server URL is not validpublic UploadRequest setNotificationConfig(UploadNotificationConfig config)
config
- the upload configuration object or null if you don't want a notification
to be displayedUploadRequest
public UploadRequest setAutoDeleteFilesAfterSuccessfulUpload(boolean autoDeleteFiles)
autoDeleteFiles
- true to auto delete files included in the
request when the upload is completed successfully.
By default this setting is set to false, and nothing gets deleted.UploadRequest
public UploadRequest setMaxRetries(int maxRetries)
maxRetries
- number of maximum retries on errorUploadRequest
public UploadRequest setDelegate(UploadStatusDelegate delegate)
UploadServiceBroadcastReceiver
, do not set the delegate or set it to null.delegate
- instance of the delegate which will receive the eventsUploadRequest