public abstract class UploadRequest<B extends UploadRequest<B>> 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 |
---|---|
B |
setAutoDeleteFilesAfterSuccessfulUpload(boolean autoDeleteFiles)
Sets the automatic file deletion after successful upload.
|
B |
setDelegate(UploadStatusDelegate delegate)
Sets the delegate which will receive the events for this upload request.
|
B |
setMaxRetries(int maxRetries)
Sets the maximum number of retries that the library will try if an error occurs,
before returning an error.
|
B |
setNotificationConfig(UploadNotificationConfig config)
Sets custom notification configuration.
|
String |
startUpload()
Start the background file upload service.
|
public UploadRequest(Context context, String uploadId, String serverUrl) throws IllegalArgumentException
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 requestIllegalArgumentException
- if one or more arguments are not validpublic String startUpload()
public B setNotificationConfig(UploadNotificationConfig config)
config
- the upload configuration object or null if you don't want a notification
to be displayedpublic B 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.public B setMaxRetries(int maxRetries)
maxRetries
- number of maximum retries on errorpublic B setDelegate(UploadStatusDelegate delegate)
UploadServiceBroadcastReceiver
, do not set the delegate or set it to null.delegate
- instance of the delegate which will receive the events