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

Commit 3c943b0

Browse files
authored
Merge pull request #28 from iterate-ch/bugfix/bucket-type-snapshot
Support new bucket type snapshot.
2 parents d1af7bf + 3b62896 commit 3c943b0

2 files changed

Lines changed: 10 additions & 2 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; }

0 commit comments

Comments
 (0)