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

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
synapticloop committed Jul 29, 2016
2 parents 5fb4656 + 21ba881 commit 90d1193
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/main/java/synapticloop/b2/BucketType.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@
*/
public enum BucketType {
allPublic,
allPrivate
allPrivate,
snapshot
}
9 changes: 8 additions & 1 deletion src/main/java/synapticloop/b2/response/B2BucketResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

0 comments on commit 90d1193

Please sign in to comment.