From 3df0852737955f9ce0d107ae64eb515ffbf67702 Mon Sep 17 00:00:00 2001 From: Fabian Morgan Date: Thu, 2 Jun 2022 18:13:54 -0700 Subject: [PATCH 1/5] update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b825f7c96..ab9309ace 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## [Unreleased] + +## [6.0.0] - 2022-06-03 ### Changed `[Incompatible]` * Updated `includeExistingFiles` to be required on B2ReplicationRule From dff538da6695e344cdb0cf1047c6d5baabd4475e Mon Sep 17 00:00:00 2001 From: fmbz <56607479+fmbz@users.noreply.github.com> Date: Fri, 29 Jul 2022 12:34:53 -0700 Subject: [PATCH 2/5] add fileLockEnabled to B2UpdateBucketRequest (#27) This PR adds fileLockEnabled parameter to B2UpdateBucketRequest --- CHANGELOG.md | 2 ++ .../structures/B2UpdateBucketRequest.java | 22 +++++++++++++++++-- .../B2StorageClientWebifierImplTest.java | 9 ++++---- .../structures/B2UpdateBucketRequestTest.java | 4 +++- 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab9309ace..26d8b9ac8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## [Unreleased] +### Added +* Added `fileLockEnabled` to `B2UpdateBucketRequest` to support enabling file lock on existing buckets ## [6.0.0] - 2022-06-03 ### Changed `[Incompatible]` diff --git a/core/src/main/java/com/backblaze/b2/client/structures/B2UpdateBucketRequest.java b/core/src/main/java/com/backblaze/b2/client/structures/B2UpdateBucketRequest.java index fa34348db..3513eae5e 100644 --- a/core/src/main/java/com/backblaze/b2/client/structures/B2UpdateBucketRequest.java +++ b/core/src/main/java/com/backblaze/b2/client/structures/B2UpdateBucketRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2021, Backblaze Inc. All Rights Reserved. + * Copyright 2022, Backblaze Inc. All Rights Reserved. * License https://www.backblaze.com/using_b2_code.html */ package com.backblaze.b2.client.structures; @@ -38,11 +38,14 @@ public class B2UpdateBucketRequest { @B2Json.optional private final B2BucketReplicationConfiguration replicationConfiguration; + @B2Json.optional + private final Boolean fileLockEnabled; + @B2Json.optional private final Integer ifRevisionIs; @B2Json.constructor(params = "accountId,bucketId,bucketType,bucketInfo,corsRules,lifecycleRules," + - "defaultRetention,defaultServerSideEncryption,replicationConfiguration,ifRevisionIs") + "defaultRetention,defaultServerSideEncryption,replicationConfiguration,fileLockEnabled,ifRevisionIs") private B2UpdateBucketRequest(String accountId, String bucketId, String bucketType, @@ -52,6 +55,7 @@ private B2UpdateBucketRequest(String accountId, B2BucketDefaultRetention defaultRetention, B2BucketServerSideEncryption defaultServerSideEncryption, B2BucketReplicationConfiguration replicationConfiguration, + Boolean fileLockEnabled, Integer ifRevisionIs) { this.accountId = accountId; this.bucketId = bucketId; @@ -62,6 +66,7 @@ private B2UpdateBucketRequest(String accountId, this.defaultRetention = defaultRetention; this.defaultServerSideEncryption = defaultServerSideEncryption; this.replicationConfiguration = replicationConfiguration; + this.fileLockEnabled = fileLockEnabled; this.ifRevisionIs = ifRevisionIs; } @@ -100,6 +105,10 @@ public B2BucketReplicationConfiguration getReplicationConfiguration() { return replicationConfiguration; } + public Boolean getFileLockEnabled() { + return fileLockEnabled; + } + public Integer getIfRevisionIs() { return ifRevisionIs; } @@ -118,6 +127,7 @@ public boolean equals(Object o) { Objects.equals(getDefaultRetention(), that.getDefaultRetention()) && Objects.equals(getDefaultServerSideEncryption(), that.getDefaultServerSideEncryption()) && Objects.equals(getReplicationConfiguration(), that.getReplicationConfiguration()) && + Objects.equals(getFileLockEnabled() , that.getFileLockEnabled()) && Objects.equals(getIfRevisionIs(), that.getIfRevisionIs()); } @@ -133,6 +143,7 @@ public int hashCode() { getDefaultRetention(), getDefaultServerSideEncryption(), getReplicationConfiguration(), + getFileLockEnabled(), getIfRevisionIs() ); } @@ -156,6 +167,7 @@ public static class Builder { private B2BucketDefaultRetention defaultRetention; private B2BucketServerSideEncryption defaultServerSideEncryption; private B2BucketReplicationConfiguration replicationConfiguration; + private Boolean fileLockEnabled; private Builder(B2Bucket bucket) { this.accountId = bucket.getAccountId(); @@ -198,6 +210,11 @@ public Builder setReplicationConfiguration(B2BucketReplicationConfiguration repl return this; } + public Builder setFileLockEnabled(Boolean fileLockEnabled) { + this.fileLockEnabled = fileLockEnabled; + return this; + } + public B2UpdateBucketRequest build() { return new B2UpdateBucketRequest( accountId, @@ -209,6 +226,7 @@ public B2UpdateBucketRequest build() { defaultRetention, defaultServerSideEncryption, replicationConfiguration, + fileLockEnabled, ifRevisionIs ); } diff --git a/core/src/test/java/com/backblaze/b2/client/B2StorageClientWebifierImplTest.java b/core/src/test/java/com/backblaze/b2/client/B2StorageClientWebifierImplTest.java index 88b08a7c1..7ac8da9eb 100644 --- a/core/src/test/java/com/backblaze/b2/client/B2StorageClientWebifierImplTest.java +++ b/core/src/test/java/com/backblaze/b2/client/B2StorageClientWebifierImplTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2021, Backblaze Inc. All Rights Reserved. + * Copyright 2022, Backblaze Inc. All Rights Reserved. * License https://www.backblaze.com/using_b2_code.html */ package com.backblaze.b2.client; @@ -136,18 +136,18 @@ public class B2StorageClientWebifierImplTest extends B2BaseTest { - private RecordingWebApiClient webApiClient = new RecordingWebApiClient(); + private final RecordingWebApiClient webApiClient = new RecordingWebApiClient(); // i'm doing most tests with the a test mode to ensure it's set on all request type. // there's a separate test it can be disabled; that test only checks one request type. - private B2StorageClientWebifierImpl webifier = new B2StorageClientWebifierImpl( + private final B2StorageClientWebifierImpl webifier = new B2StorageClientWebifierImpl( webApiClient, USER_AGENT, MASTER_URL, B2TestMode.FORCE_CAP_EXCEEDED ); - private B2ContentSink noopContentHandler = (r, i) -> {}; + private final B2ContentSink noopContentHandler = (r, i) -> {}; @Rule @@ -1139,6 +1139,7 @@ public void testUpdateBucket() throws B2Exception { " ],\n" + " \"defaultRetention\": null,\n" + " \"defaultServerSideEncryption\": null,\n" + + " \"fileLockEnabled\": null,\n" + " \"ifRevisionIs\": 1,\n" + " \"lifecycleRules\": null,\n" + " \"replicationConfiguration\": null\n" + diff --git a/core/src/test/java/com/backblaze/b2/client/structures/B2UpdateBucketRequestTest.java b/core/src/test/java/com/backblaze/b2/client/structures/B2UpdateBucketRequestTest.java index f7d22a747..13dc1c12c 100644 --- a/core/src/test/java/com/backblaze/b2/client/structures/B2UpdateBucketRequestTest.java +++ b/core/src/test/java/com/backblaze/b2/client/structures/B2UpdateBucketRequestTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2021, Backblaze Inc. All Rights Reserved. + * Copyright 2022, Backblaze Inc. All Rights Reserved. * License https://www.backblaze.com/using_b2_code.html */ package com.backblaze.b2.client.structures; @@ -133,6 +133,7 @@ public void testFullUpdateBucketRequest() { .setDefaultRetention(defaultRetention) .setDefaultServerSideEncryption(defaultServerSideEncryption) .setReplicationConfiguration(replicationConfiguration) + .setFileLockEnabled(Boolean.TRUE) .build(); // Convert from B2UpdateBucketRequest -> json @@ -171,6 +172,7 @@ public void testFullUpdateBucketRequest() { " \"algorithm\": \"AES256\",\n" + " \"mode\": \"SSE-B2\"\n" + " },\n" + + " \"fileLockEnabled\": true,\n" + " \"ifRevisionIs\": 1,\n" + " \"lifecycleRules\": [\n" + " {\n" + From f4069c642646eee192a1a3ffff025f88a71e7cf7 Mon Sep 17 00:00:00 2001 From: Fabian Morgan Date: Wed, 24 Aug 2022 15:49:11 -0700 Subject: [PATCH 3/5] update gradle.properties --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index dc7899c3a..1c686675a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Copyright 2022, Backblaze Inc. All Rights Reserved. # License https://www.backblaze.com/using_b2_code.html -version=6.0.0 +version=6.0.1-PRIVATE group=com.backblaze.b2 From 7e38a0df9f05f8280640a56ee79b9c5d8a0e737b Mon Sep 17 00:00:00 2001 From: Charlie La Mothe Date: Fri, 2 Sep 2022 10:23:52 -0700 Subject: [PATCH 4/5] Update changelog and update version to 6.1.0-PRIVATE --- CHANGELOG.md | 4 +++- gradle.properties | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26d8b9ac8..b829fc036 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [Unreleased] ### Added +* Added support for Java 8's `-parameters` option so constructor parameters do not need to be reiterated in `B2Json.constructor#params` * Added `fileLockEnabled` to `B2UpdateBucketRequest` to support enabling file lock on existing buckets ## [6.0.0] - 2022-06-03 @@ -170,7 +171,8 @@ * These changes were driven by switching our internal b2-sdk uses to use the http client from the sdk instead of a different, custom interface. -[Unreleased]: https://github.com/Backblaze/b2-sdk-java/compare/v5.0.0...HEAD +[Unreleased]: https://github.com/Backblaze/b2-sdk-java/compare/v6.0.0...HEAD +[6.0.0]: https://github.com/Backblaze/b2-sdk-java/releases/tag/v6.0.0 [5.0.0]: https://github.com/Backblaze/b2-sdk-java/releases/tag/v5.0.0 [4.0.0]: https://github.com/Backblaze/b2-sdk-java/releases/tag/v4.0.0 [3.1.0]: https://github.com/Backblaze/b2-sdk-java/releases/tag/v3.1.0 diff --git a/gradle.properties b/gradle.properties index 1c686675a..42adaa339 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Copyright 2022, Backblaze Inc. All Rights Reserved. # License https://www.backblaze.com/using_b2_code.html -version=6.0.1-PRIVATE +version=6.1.0-PRIVATE group=com.backblaze.b2 From 676d0059e178be9c4be6c4dd587eb374d13d77aa Mon Sep 17 00:00:00 2001 From: Fabian Morgan Date: Fri, 16 Sep 2022 13:00:02 -0700 Subject: [PATCH 5/5] update CHANGELOG.md and gradle.properties --- CHANGELOG.md | 5 +++-- gradle.properties | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b829fc036..17f0db2c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [Unreleased] +## [6.1.0] - 2022-09-19 ### Added * Added support for Java 8's `-parameters` option so constructor parameters do not need to be reiterated in `B2Json.constructor#params` * Added `fileLockEnabled` to `B2UpdateBucketRequest` to support enabling file lock on existing buckets @@ -171,7 +171,8 @@ * These changes were driven by switching our internal b2-sdk uses to use the http client from the sdk instead of a different, custom interface. -[Unreleased]: https://github.com/Backblaze/b2-sdk-java/compare/v6.0.0...HEAD +[Unreleased]: https://github.com/Backblaze/b2-sdk-java/compare/v6.1.0...HEAD +[6.1.0]: https://github.com/Backblaze/b2-sdk-java/releases/tag/v6.1.0 [6.0.0]: https://github.com/Backblaze/b2-sdk-java/releases/tag/v6.0.0 [5.0.0]: https://github.com/Backblaze/b2-sdk-java/releases/tag/v5.0.0 [4.0.0]: https://github.com/Backblaze/b2-sdk-java/releases/tag/v4.0.0 diff --git a/gradle.properties b/gradle.properties index 42adaa339..951d87c5e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Copyright 2022, Backblaze Inc. All Rights Reserved. # License https://www.backblaze.com/using_b2_code.html -version=6.1.0-PRIVATE +version=6.1.0 group=com.backblaze.b2