KontainPluton commented on code in PR #40:
URL: https://github.com/apache/sis/pull/40#discussion_r2833613543


##########
endorsed/src/org.apache.sis.cloud.aws/main/org/apache/sis/cloud/aws/s3/ClientFileSystem.java:
##########
@@ -110,11 +135,22 @@ final class ClientFileSystem extends FileSystem {
         ArgumentChecks.ensureNonEmpty("separator", separator);
         this.provider  = provider;
         this.accessKey = accessKey;
-        S3ClientBuilder builder = S3Client.builder().credentialsProvider(
-                
StaticCredentialsProvider.create(AwsBasicCredentials.create(accessKey, 
secret)));
+        S3ClientBuilder builder = S3Client.builder();
+        if (secret != null) {
+            builder = 
builder.credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create(accessKey,
 secret)));
+        }
         if (region != null) {
             builder = builder.region(region);
         }
+        this.host = host;
+        this.port = port;
+        this.isHttps = isHttps;
+        if (host != null) {
+            String hostname = (port < 0 ? host + ':' + port : host);
+            String protocol = (this.isHttps ? "https" : "http");
+            builder = builder.endpointOverride(URI.create(protocol + "://" + 
hostname))

Review Comment:
   Now we manage URISyntaxExcptiion



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to