public interface ResumableUpload extends ResumableUploadBase
You will implement this interface together with UploadProgress
interface when you would like to provide one or more of the following features:
Modifier and Type | Method and Description |
---|---|
void |
cancelUpload()
In this method implementation you can delete partially uploaded file.
|
long |
getBytesUploaded()
Amount of bytes successfully saved to your storage.
|
boolean |
getCheckInOnFileComplete()
Indicates if item will be checked-in by the engine when last chunk of a file is uploaded
if item was checked in when upload started.
|
long |
getLastChunkSaved()
The date and time when the last chunk of file was saved in your storage.
|
long |
getTotalContentLength()
Total file size that is being uploaded.
|
void |
setCheckInOnFileComplete(boolean value)
Shall store value which indicates whether file will be checked in when upload finishes.
|
void cancelUpload() throws LockedException, ServerException
Often during long-continued upload you will keep the old file content to be returned by GET requests and store the new file content in a temporary file (or temporary field in database, etc). To delete this partially uploaded content client can submit CANCELUPLOAD command, the Engine will call this method in this case.
If the item was automatically checked-out by the Engine when upload started it will be automatically checked-in by the Engine after this call.
Example Request:
CANCELUPLOAD /LargeFile.doc HTTP/1.1 Host: http://server:8580/Response:
HTTP/1.1 200 OKResponse:
LockedException
- - this item or its parent was locked and client did not provide lock token.ServerException
- - in case of an error.long getLastChunkSaved() throws ServerException
Requested by the Engine during a call to UploadProgress.getUploadProgress()
.
ServerException
- in case of an error.long getBytesUploaded() throws ServerException
Client will use value returned by this property to restore broken upload. This value shall always reflect number of bytes already stored to persistent medium.
Requested by the Engine during a call to UploadProgress.getUploadProgress()
.
ServerException
- in case of an error.long getTotalContentLength() throws ServerException
This value is passed to File.write(java.io.InputStream, java.lang.String, long, long)
method. Usually AJAX/HTML based clients will use value returned by this property to display upload progress.
Requested by the Engine during a call to UploadProgress.getUploadProgress()
.
ServerException
- in case of an error.boolean getCheckInOnFileComplete() throws ServerException
ServerException
- in case of an error.void setCheckInOnFileComplete(boolean value) throws ServerException
value
- True if item will be checked in when upload finishes.ServerException
- in case of an error.Copyright © ITHit. All Rights Reserved.