diff --git a/src/main/java/synapticloop/b2/BucketType.java b/src/main/java/synapticloop/b2/BucketType.java index 67434e7..0b8e179 100644 --- a/src/main/java/synapticloop/b2/BucketType.java +++ b/src/main/java/synapticloop/b2/BucketType.java @@ -23,5 +23,6 @@ */ public enum BucketType { allPublic, - allPrivate + allPrivate, + snapshot } diff --git a/src/main/java/synapticloop/b2/response/B2BucketResponse.java b/src/main/java/synapticloop/b2/response/B2BucketResponse.java index 997941c..739daca 100644 --- a/src/main/java/synapticloop/b2/response/B2BucketResponse.java +++ b/src/main/java/synapticloop/b2/response/B2BucketResponse.java @@ -95,7 +95,14 @@ public B2BucketResponse(final JSONObject response) throws B2ApiException { * * @return The bucket type */ - public BucketType getBucketType() { return BucketType.valueOf(this.bucketType); } + public BucketType getBucketType() { + try { + return BucketType.valueOf(this.bucketType); + } + catch(IllegalArgumentException e) { + return null; + } + } @Override protected Logger getLogger() { return LOGGER; } diff --git a/src/main/java/synapticloop/b2/response/B2ListPartsResponse.java b/src/main/java/synapticloop/b2/response/B2ListPartsResponse.java index 2de4080..49cbce4 100644 --- a/src/main/java/synapticloop/b2/response/B2ListPartsResponse.java +++ b/src/main/java/synapticloop/b2/response/B2ListPartsResponse.java @@ -33,7 +33,7 @@ public class B2ListPartsResponse extends BaseB2Response { public B2ListPartsResponse(String json) throws B2ApiException { super(json); - this.nextPartNumber = this.readInt(B2ResponseProperties.KEY_NEXT_FILE_ID); + this.nextPartNumber = this.readInt(B2ResponseProperties.KEY_NEXT_PART_NUMBER); JSONArray filesArray = this.readObjects(B2ResponseProperties.KEY_PARTS); diff --git a/src/main/java/synapticloop/b2/response/B2ResponseProperties.java b/src/main/java/synapticloop/b2/response/B2ResponseProperties.java index e05b4f5..2b6b99a 100644 --- a/src/main/java/synapticloop/b2/response/B2ResponseProperties.java +++ b/src/main/java/synapticloop/b2/response/B2ResponseProperties.java @@ -40,5 +40,6 @@ public final class B2ResponseProperties { public static final String KEY_BUCKETS = "buckets"; public static final String KEY_PARTS = "parts"; public static final String KEY_PART_NUMBER = "partNumber"; + public static final String KEY_NEXT_PART_NUMBER = "nextPartNumber"; public static final String KEY_MINIMUM_PART_SIZE = "minimumPartSize"; }