Skip to content

Commit 647c809

Browse files
fix: add builders to S3EncryptionClientException class (#450)
* update the CRT version --------- Co-authored-by: seebees <[email protected]>
1 parent fdbc27d commit 647c809

File tree

2 files changed

+58
-7
lines changed

2 files changed

+58
-7
lines changed

Diff for: pom.xml

+5-5
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
<dependency>
5757
<groupId>software.amazon.awssdk</groupId>
5858
<artifactId>bom</artifactId>
59-
<version>2.29.29</version>
59+
<version>2.30.38</version>
6060
<optional>true</optional>
6161
<type>pom</type>
6262
<scope>import</scope>
@@ -68,21 +68,21 @@
6868
<dependency>
6969
<groupId>software.amazon.awssdk</groupId>
7070
<artifactId>s3</artifactId>
71-
<version>2.29.29</version>
71+
<version>2.30.38</version>
7272
</dependency>
7373

7474
<dependency>
7575
<groupId>software.amazon.awssdk</groupId>
7676
<artifactId>kms</artifactId>
77-
<version>2.29.29</version>
77+
<version>2.30.38</version>
7878
</dependency>
7979

8080
<!-- Used when enableMultipartPutObject is configured -->
8181
<dependency>
8282
<groupId>software.amazon.awssdk.crt</groupId>
8383
<artifactId>aws-crt</artifactId>
8484
<optional>true</optional>
85-
<version>0.33.5</version>
85+
<version>0.36.3</version>
8686
</dependency>
8787

8888
<dependency>
@@ -163,7 +163,7 @@
163163
<dependency>
164164
<groupId>software.amazon.awssdk</groupId>
165165
<artifactId>sts</artifactId>
166-
<version>2.29.29</version>
166+
<version>2.30.38</version>
167167
<optional>true</optional>
168168
<scope>test</scope>
169169
</dependency>

Diff for: src/main/java/software/amazon/encryption/s3/S3EncryptionClientException.java

+53-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,65 @@
66

77
public class S3EncryptionClientException extends SdkClientException {
88

9+
private S3EncryptionClientException(Builder b) {
10+
super(b);
11+
}
12+
913
public S3EncryptionClientException(String message) {
10-
super(SdkClientException.builder()
14+
super(S3EncryptionClientException.builder()
1115
.message(message));
1216
}
1317

1418
public S3EncryptionClientException(String message, Throwable cause) {
15-
super(SdkClientException.builder()
19+
super(S3EncryptionClientException.builder()
1620
.message(message)
1721
.cause(cause));
1822
}
23+
24+
@Override
25+
public Builder toBuilder() {
26+
return new BuilderImpl(this);
27+
}
28+
29+
public static Builder builder() {
30+
return new BuilderImpl();
31+
}
32+
33+
public interface Builder extends SdkClientException.Builder {
34+
@Override
35+
Builder message(String message);
36+
37+
@Override
38+
Builder cause(Throwable cause);
39+
40+
@Override
41+
S3EncryptionClientException build();
42+
}
43+
44+
protected static final class BuilderImpl extends SdkClientException.BuilderImpl implements Builder {
45+
46+
protected BuilderImpl() {
47+
}
48+
49+
protected BuilderImpl(S3EncryptionClientException ex) {
50+
super(ex);
51+
}
52+
53+
@Override
54+
public Builder message(String message) {
55+
this.message = message;
56+
return this;
57+
}
58+
59+
@Override
60+
public Builder cause(Throwable cause) {
61+
this.cause = cause;
62+
return this;
63+
}
64+
65+
@Override
66+
public S3EncryptionClientException build() {
67+
return new S3EncryptionClientException(this);
68+
}
69+
}
1970
}

0 commit comments

Comments
 (0)