Add use-path-style-access to AmazonS3Properties

This commit is contained in:
David Turanski
2020-09-09 18:26:20 -04:00
parent 7dacd25a60
commit fd5cadc60d
4 changed files with 17 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ The **$$s3$$** $$sink$$ has the following options:
//tag::configuration-properties[]
$$s3.common.endpoint-url$$:: $$Optional endpoint url to connect to s3 compatible storage.$$ *($$String$$, default: `$$<none>$$`)*
$$s3.common.path-style-access$$:: $$Use path style access.$$ *($$Boolean$$, default: `$$false$$`)*
$$s3.consumer.acl$$:: $$S3 Object access control list.$$ *($$CannedAccessControlList$$, default: `$$<none>$$`, possible values: `private`,`public-read`,`public-read-write`,`authenticated-read`,`log-delivery-write`,`bucket-owner-read`,`bucket-owner-full-control`,`aws-exec-read`)*
$$s3.consumer.acl-expression$$:: $$Expression to evaluate S3 Object access control list.$$ *($$Expression$$, default: `$$<none>$$`)*
$$s3.consumer.bucket$$:: $$AWS bucket for target file(s) to store.$$ *($$String$$, default: `$$<none>$$`)*

View File

@@ -54,6 +54,7 @@ $$file.consumer.markers-json$$:: $$When 'fileMarkers == true', specify if they s
$$file.consumer.mode$$:: $$The FileReadingMode to use for file reading sources. Values are 'ref' - The File object, 'lines' - a message per line, or 'contents' - the contents as bytes.$$ *($$FileReadingMode$$, default: `$$<none>$$`, possible values: `ref`,`lines`,`contents`)*
$$file.consumer.with-markers$$:: $$Set to true to emit start of file/end of file marker messages before/after the data. Only valid with FileReadingMode 'lines'.$$ *($$Boolean$$, default: `$$<none>$$`)*
$$s3.common.endpoint-url$$:: $$Optional endpoint url to connect to s3 compatible storage.$$ *($$String$$, default: `$$<none>$$`)*
$$s3.common.path-style-access$$:: $$Use path style access.$$ *($$Boolean$$, default: `$$false$$`)*
$$s3.supplier.auto-create-local-dir$$:: $$Create or not the local directory.$$ *($$Boolean$$, default: `$$true$$`)*
$$s3.supplier.delete-remote-files$$:: $$Delete or not remote files after processing.$$ *($$Boolean$$, default: `$$false$$`)*
$$s3.supplier.filename-pattern$$:: $$The pattern to filter remote files.$$ *($$String$$, default: `$$<none>$$`)*

View File

@@ -20,6 +20,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* @author Timo Salm
* @author David Turanski
*/
@ConfigurationProperties("s3.common")
public class AmazonS3Properties {
@@ -29,6 +30,19 @@ public class AmazonS3Properties {
*/
private String endpointUrl;
/**
* Use path style access.
*/
private boolean pathStyleAccess;
public boolean isPathStyleAccess() {
return pathStyleAccess;
}
public void setPathStyleAccess(boolean pathStyleAccess) {
this.pathStyleAccess = pathStyleAccess;
}
public String getEndpointUrl() {
return this.endpointUrl;
}

View File

@@ -46,6 +46,7 @@ public class CompatibleStorageAmazonS3Configuration {
builder.setEndpointConfiguration(endpointConfiguration);
return builder
.withCredentials(awsCredentialsProvider)
.withPathStyleAccessEnabled(amazonS3Properties.isPathStyleAccess())
.build();
}
}