From 2a90bd501b5b3aad11ee8b92f276302741e5a91e Mon Sep 17 00:00:00 2001 From: Tony Kurc Date: Sun, 8 Nov 2015 19:51:19 -0500 Subject: [PATCH] NIFI-797 Corrected URL for PutS3 to include correct protocol and endpoint by region. - corrected a missed 'final' on org.apache.nifi.processors.aws.AbstractAWSProcessor.relationships - added protected method org.apache.nifi.processors.aws.AbstractAWSProcessor.getRegion() - added protected method org.apache.nifi.processors.aws.s3.AbstractS3Processor.getUrlForObject(String, String) - explicitly set AWS client protocol to HTTPS, and created a static final field with comments if other protocols may be considered - added a static final field for the UserAgent Reviewed by Aldrin Piri --- .../processors/aws/AbstractAWSProcessor.java | 22 +++++++++++++++---- .../aws/s3/AbstractS3Processor.java | 12 ++++++++++ .../nifi/processors/aws/s3/PutS3Object.java | 2 +- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/AbstractAWSProcessor.java b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/AbstractAWSProcessor.java index e2ae31eb70..165a7596d9 100644 --- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/AbstractAWSProcessor.java +++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/AbstractAWSProcessor.java @@ -40,6 +40,7 @@ import org.apache.nifi.processor.util.StandardValidators; import com.amazonaws.AmazonWebServiceClient; import com.amazonaws.ClientConfiguration; +import com.amazonaws.Protocol; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.AnonymousAWSCredentials; import com.amazonaws.auth.BasicAWSCredentials; @@ -54,7 +55,7 @@ public abstract class AbstractAWSProcessor relationships = Collections.unmodifiableSet( + public static final Set relationships = Collections.unmodifiableSet( new HashSet<>(Arrays.asList(REL_SUCCESS, REL_FAILURE))); public static final PropertyDescriptor CREDENTAILS_FILE = new PropertyDescriptor.Builder() @@ -92,6 +93,11 @@ public abstract class AbstractAWSProcessor