Skip to content
This repository was archived by the owner on Dec 6, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/main/java/synapticloop/b2/response/B2UploadPartResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class B2UploadPartResponse extends BaseB2Response {
private final Integer partNumber;
private final Long contentLength;
private final String contentSha1;
private final Long uploadTimestamp;

public B2UploadPartResponse(String json) throws B2ApiException {
super(json);
Expand All @@ -36,6 +37,7 @@ public B2UploadPartResponse(String json) throws B2ApiException {
this.partNumber = this.readInt(B2ResponseProperties.KEY_PART_NUMBER);
this.contentLength = this.readLong(B2ResponseProperties.KEY_CONTENT_LENGTH);
this.contentSha1 = this.readString(B2ResponseProperties.KEY_CONTENT_SHA1);
this.uploadTimestamp = this.readLong(B2ResponseProperties.KEY_UPLOAD_TIMESTAMP);

this.warnOnMissedKeys();
}
Expand All @@ -47,6 +49,7 @@ public B2UploadPartResponse(final JSONObject response) throws B2ApiException {
this.partNumber = this.readInt(B2ResponseProperties.KEY_PART_NUMBER);
this.contentLength = this.readLong(B2ResponseProperties.KEY_CONTENT_LENGTH);
this.contentSha1 = this.readString(B2ResponseProperties.KEY_CONTENT_SHA1);
this.uploadTimestamp = this.readLong(B2ResponseProperties.KEY_UPLOAD_TIMESTAMP);

this.warnOnMissedKeys();
}
Expand All @@ -67,6 +70,13 @@ public String getContentSha1() {
return contentSha1;
}

/**
* Return the timestamp that the part was uploaded
*
* @return the timestamp for when the part was uploaded
*/
public Long getUploadTimestamp() { return this.uploadTimestamp; }

@Override
protected Logger getLogger() { return LOGGER; }

Expand Down