Skip to content

Commit 6d82bf4

Browse files
committed
adds aws deps
1 parent 7907698 commit 6d82bf4

3 files changed

Lines changed: 24 additions & 5 deletions

File tree

adapters/klab.ogc/pom.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,24 @@
8989
<artifactId>aws-lightweight-client-java</artifactId>
9090
<version>${s3.version}</version>
9191
</dependency>
92+
93+
<!-- AWS Dependencies -->
94+
<dependency>
95+
<artifactId>apache-client</artifactId>
96+
<groupId>software.amazon.awssdk</groupId>
97+
<version>2.29.14</version>
98+
<exclusions>
99+
<exclusion>
100+
<groupId>commons-logging</groupId>
101+
<artifactId>commons-logging</artifactId>
102+
</exclusion>
103+
</exclusions>
104+
</dependency>
105+
<dependency>
106+
<groupId>software.amazon.awssdk</groupId>
107+
<artifactId>protocol-core</artifactId>
108+
<version>2.29.14</version>
109+
</dependency>
92110

93111
<!-- <dependency> <groupId>org.geotools.xsd</groupId> <artifactId>gt-xsd-core</artifactId>
94112
<version>${geotools.version}</version> </dependency>

adapters/klab.ogc/src/main/java/org/integratedmodelling/klab/stac/STACEncoder.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ private void sortByDate(List<HMStacItem> items, IMonitor monitor) {
181181
+ items.get(items.size() - 1).getTimestamp() + "]");
182182
}
183183

184-
private Client buildS3Client(String bucketRegion) throws IOException {
185-
ExternalAuthenticationCredentials awsCredentials = Authentication.INSTANCE.getCredentials(S3URLUtils.AWS_ENDPOINT);
184+
private Client buildS3Client(String endpointURL) throws IOException {
185+
ExternalAuthenticationCredentials awsCredentials = Authentication.INSTANCE.getCredentials(endpointURL);
186186
Credentials credentials = null;
187187
try {
188188
credentials = Credentials.of(awsCredentials.getCredentials().get(0), awsCredentials.getCredentials().get(1));
@@ -451,9 +451,9 @@ public boolean test(HMStacAsset asset) { // Assuming for now that "eo:bands" wou
451451
RegionMap regionTransformed = RegionMap.fromEnvelopeAndGrid(regionEnvelope, (int) grid.getXCells(),
452452
(int) grid.getYCells());
453453

454-
if (resource.getParameters().contains("awsRegion")) {
455-
String bucketRegion = resource.getParameters().get("awsRegion", String.class);
456-
Client s3Client = buildS3Client(bucketRegion);
454+
if (resource.getParameters().contains("s3EndpointUrl")) {
455+
String s3EndpointURL = resource.getParameters().get("s3EndpointUrl", String.class);
456+
Client s3Client = buildS3Client(s3EndpointURL);
457457
collection.setS3Client(s3Client);
458458
}
459459
var time = effectiveTime;

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@
145145
<hamcrest.version>2.2</hamcrest.version>
146146
<powermock.version>2.0.9</powermock.version>
147147
<s3.version>0.1.23</s3.version>
148+
<aws.version>2.29.14</aws.version>
148149
<keycloak.version>24.0.4</keycloak.version>
149150
<poi.version>5.4.1</poi.version>
150151
<commons-io.version>2.14.0</commons-io.version>

0 commit comments

Comments
 (0)