@BoxResourceType(value="upload_session") public class BoxFileUploadSession extends BoxResource
Modifier and Type | Class and Description |
---|---|
static class |
BoxFileUploadSession.Endpoints
Represents the end points specific to an upload session.
|
class |
BoxFileUploadSession.Info
Model contains the upload session information.
|
Modifier and Type | Method and Description |
---|---|
void |
abort()
Abort an upload session, discarding any chunks that were uploaded to it.
|
BoxFile.Info |
commit(String digest,
List<BoxFileUploadSessionPart> parts,
Map<String,String> attributes,
String ifMatch,
String ifNoneMatch)
Commit an upload session after all parts have been uploaded, creating the new file or the version.
|
BoxFileUploadSession.Info |
getStatus()
Get the status of the upload session.
|
protected Iterable<BoxFileUploadSessionPart> |
listParts()
Returns a list of all parts that have been uploaded to an upload session.
|
BoxFileUploadSessionPartList |
listParts(int offset,
int limit)
Returns a list of all parts that have been uploaded to an upload session.
|
BoxFileUploadSessionPart |
uploadPart(byte[] data,
long offset,
int partSize,
long totalSizeOfFile)
Uploads bytes to an open upload session.
|
BoxFileUploadSessionPart |
uploadPart(InputStream stream,
long offset,
int partSize,
long totalSizeOfFile)
Uploads chunk of a stream to an open upload session.
|
equals, getAPI, getID, getResourceType, hashCode
public BoxFileUploadSessionPart uploadPart(InputStream stream, long offset, int partSize, long totalSizeOfFile)
stream
- the stream that is used to read the chunck using the offset and part size.offset
- the byte position where the chunk begins in the file.partSize
- the part size returned as part of the upload session instance creation.
Only the last chunk can have a lesser value.totalSizeOfFile
- The total size of the file being uploaded.public BoxFileUploadSessionPart uploadPart(byte[] data, long offset, int partSize, long totalSizeOfFile)
data
- dataoffset
- the byte position where the chunk begins in the file.partSize
- the part size returned as part of the upload session instance creation.
Only the last chunk can have a lesser value.totalSizeOfFile
- The total size of the file being uploaded.public BoxFileUploadSessionPartList listParts(int offset, int limit)
offset
- paging marker for the list of parts.limit
- maximum number of parts to return.protected Iterable<BoxFileUploadSessionPart> listParts()
public BoxFile.Info commit(String digest, List<BoxFileUploadSessionPart> parts, Map<String,String> attributes, String ifMatch, String ifNoneMatch)
digest
- the base64-encoded SHA-1 hash of the file being uploaded.parts
- the list of uploaded parts to be committed.attributes
- the key value pairs of attributes from the file instance.ifMatch
- ensures that your app only alters files/folders on Box if you have the current version.ifNoneMatch
- ensure that it retrieve unnecessary data if the most current version of file is on-hand.public BoxFileUploadSession.Info getStatus()
public void abort()