Skip to content
This repository was archived by the owner on Dec 6, 2024. It is now read-only.

Commit 90d1193

Browse files
author
synapticloop
committed
2 parents 5fb4656 + 21ba881 commit 90d1193

4 files changed

Lines changed: 12 additions & 3 deletions

File tree

src/main/java/synapticloop/b2/BucketType.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@
2323
*/
2424
public enum BucketType {
2525
allPublic,
26-
allPrivate
26+
allPrivate,
27+
snapshot
2728
}

src/main/java/synapticloop/b2/response/B2BucketResponse.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,14 @@ public B2BucketResponse(final JSONObject response) throws B2ApiException {
9595
*
9696
* @return The bucket type
9797
*/
98-
public BucketType getBucketType() { return BucketType.valueOf(this.bucketType); }
98+
public BucketType getBucketType() {
99+
try {
100+
return BucketType.valueOf(this.bucketType);
101+
}
102+
catch(IllegalArgumentException e) {
103+
return null;
104+
}
105+
}
99106

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

src/main/java/synapticloop/b2/response/B2ListPartsResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class B2ListPartsResponse extends BaseB2Response {
3333
public B2ListPartsResponse(String json) throws B2ApiException {
3434
super(json);
3535

36-
this.nextPartNumber = this.readInt(B2ResponseProperties.KEY_NEXT_FILE_ID);
36+
this.nextPartNumber = this.readInt(B2ResponseProperties.KEY_NEXT_PART_NUMBER);
3737

3838
JSONArray filesArray = this.readObjects(B2ResponseProperties.KEY_PARTS);
3939

src/main/java/synapticloop/b2/response/B2ResponseProperties.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,6 @@ public final class B2ResponseProperties {
4040
public static final String KEY_BUCKETS = "buckets";
4141
public static final String KEY_PARTS = "parts";
4242
public static final String KEY_PART_NUMBER = "partNumber";
43+
public static final String KEY_NEXT_PART_NUMBER = "nextPartNumber";
4344
public static final String KEY_MINIMUM_PART_SIZE = "minimumPartSize";
4445
}

0 commit comments

Comments
 (0)