Skip to content

Commit

Permalink
Merge branch 'gaul:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
jixinchi authored Nov 13, 2023
2 parents 5900be7 + 6089343 commit 7789406
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>11</java.version>
<jclouds.version>2.5.0</jclouds.version>
<jetty.version>11.0.17</jetty.version>
<jetty.version>11.0.18</jetty.version>
<slf4j.version>2.0.9</slf4j.version>
<shade.prefix>${project.groupId}.shaded</shade.prefix>
<surefire.version>3.0.0</surefire.version>
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/org/gaul/s3proxy/S3Proxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,18 @@ public static Builder fromProperties(Properties properties)
S3ProxyConstants.PROPERTY_ENDPOINT);
String secureEndpoint = properties.getProperty(
S3ProxyConstants.PROPERTY_SECURE_ENDPOINT);
if (endpoint == null && secureEndpoint == null) {
boolean hasEndpoint = !Strings.isNullOrEmpty(endpoint);
boolean hasSecureEndpoint = !Strings.isNullOrEmpty(secureEndpoint);
if (!hasEndpoint && !hasSecureEndpoint) {
throw new IllegalArgumentException(
"Properties file must contain: " +
S3ProxyConstants.PROPERTY_ENDPOINT + " or " +
S3ProxyConstants.PROPERTY_SECURE_ENDPOINT);
}
if (endpoint != null) {
if (hasEndpoint) {
builder.endpoint(new URI(endpoint));
}
if (secureEndpoint != null) {
if (hasSecureEndpoint) {
builder.secureEndpoint(new URI(secureEndpoint));
}

Expand Down

0 comments on commit 7789406

Please sign in to comment.