Skip to content

Commit

Permalink
fix: use object key
Browse files Browse the repository at this point in the history
  • Loading branch information
ronjaquensel committed Dec 4, 2024
1 parent f814df8 commit 3cd7dbf
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import static org.eclipse.edc.aws.s3.spi.S3BucketSchema.ACCESS_KEY_ID;
import static org.eclipse.edc.aws.s3.spi.S3BucketSchema.BUCKET_NAME;
import static org.eclipse.edc.aws.s3.spi.S3BucketSchema.ENDPOINT_OVERRIDE;
import static org.eclipse.edc.aws.s3.spi.S3BucketSchema.OBJECT_NAME;
import static org.eclipse.edc.aws.s3.spi.S3BucketSchema.REGION;
import static org.eclipse.edc.aws.s3.spi.S3BucketSchema.SECRET_ACCESS_KEY;

Expand Down Expand Up @@ -78,6 +79,11 @@ public Builder bucketName(String bucketName) {
dataAddressBuilder.property(BUCKET_NAME, bucketName);
return this;
}

public Builder objectName(String objectName) {
dataAddressBuilder.property(OBJECT_NAME, objectName);
return this;
}

public Builder endpointOverride(String endpointOverride) {
dataAddressBuilder.property(ENDPOINT_OVERRIDE, endpointOverride);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ private StatusResult<ProvisionResponse> provisionSucceeded(S3BucketResourceDefin
.hasToken(true)
.region(resourceDefinition.getRegionId())
.bucketName(resourceDefinition.getBucketName())
.objectName(resourceDefinition.getObjectName())
.transferProcessId(resourceDefinition.getTransferProcessId())
.resourceName(resourceDefinition.getBucketName())
.endpointOverride(resourceDefinition.getEndpointOverride())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
public class S3BucketResourceDefinition extends ResourceDefinition {
private String regionId;
private String bucketName;
private String objectName;
private String endpointOverride;
private String accessKeyId;
private String secretAccessKey;
Expand All @@ -45,6 +46,10 @@ public String getBucketName() {
return bucketName;
}

public String getObjectName() {
return objectName;
}

public String getEndpointOverride() {
return endpointOverride;
}
Expand All @@ -62,6 +67,7 @@ public Builder toBuilder() {
return initializeBuilder(new Builder())
.regionId(regionId)
.bucketName(bucketName)
.objectName(objectName)
.endpointOverride(endpointOverride)
.accessKeyId(accessKeyId)
.secretAccessKey(secretAccessKey);
Expand All @@ -87,6 +93,11 @@ public Builder bucketName(String bucketName) {
resourceDefinition.bucketName = bucketName;
return this;
}

public Builder objectName(String objectName) {
resourceDefinition.objectName = objectName;
return this;
}

public Builder endpointOverride(String endpointOverride) {
resourceDefinition.endpointOverride = endpointOverride;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import static java.util.UUID.randomUUID;
import static org.eclipse.edc.aws.s3.spi.S3BucketSchema.ACCESS_KEY_ID;
import static org.eclipse.edc.aws.s3.spi.S3BucketSchema.OBJECT_NAME;
import static org.eclipse.edc.aws.s3.spi.S3BucketSchema.SECRET_ACCESS_KEY;

/**
Expand All @@ -44,6 +45,7 @@ public ResourceDefinition generate(TransferProcess transferProcess, Policy polic

return S3BucketResourceDefinition.Builder.newInstance().id(id)
.bucketName(dataDestination.getStringProperty(S3BucketSchema.BUCKET_NAME))
.objectName(dataDestination.getStringProperty(OBJECT_NAME))
.regionId(dataDestination.getStringProperty(S3BucketSchema.REGION))
.endpointOverride(endpointOverride)
.accessKeyId(transferProcess.getDataDestination().getStringProperty(ACCESS_KEY_ID))
Expand Down

0 comments on commit 3cd7dbf

Please sign in to comment.