NIFI-3228 added s3.contenttype in PutS3Object

Signed-off-by: James Wing <jvwing@gmail.com>

This closes #1362.
This commit is contained in:
Pierre Villard 2016-12-28 15:26:28 +01:00 committed by James Wing
parent 2ea8b4122b
commit 16898668c2
1 changed files with 3 additions and 1 deletions

View File

@ -39,7 +39,6 @@ import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantLock;
import com.amazonaws.services.s3.model.AmazonS3Exception;
import org.apache.nifi.annotation.behavior.DynamicProperty; import org.apache.nifi.annotation.behavior.DynamicProperty;
import org.apache.nifi.annotation.behavior.InputRequirement; import org.apache.nifi.annotation.behavior.InputRequirement;
import org.apache.nifi.annotation.behavior.InputRequirement.Requirement; import org.apache.nifi.annotation.behavior.InputRequirement.Requirement;
@ -64,6 +63,7 @@ import com.amazonaws.AmazonClientException;
import com.amazonaws.services.s3.AmazonS3Client; import com.amazonaws.services.s3.AmazonS3Client;
import com.amazonaws.services.s3.model.AbortMultipartUploadRequest; import com.amazonaws.services.s3.model.AbortMultipartUploadRequest;
import com.amazonaws.services.s3.model.AccessControlList; import com.amazonaws.services.s3.model.AccessControlList;
import com.amazonaws.services.s3.model.AmazonS3Exception;
import com.amazonaws.services.s3.model.CannedAccessControlList; import com.amazonaws.services.s3.model.CannedAccessControlList;
import com.amazonaws.services.s3.model.CompleteMultipartUploadRequest; import com.amazonaws.services.s3.model.CompleteMultipartUploadRequest;
import com.amazonaws.services.s3.model.CompleteMultipartUploadResult; import com.amazonaws.services.s3.model.CompleteMultipartUploadResult;
@ -426,6 +426,7 @@ public class PutS3Object extends AbstractS3Processor {
.evaluateAttributeExpressions(ff).getValue(); .evaluateAttributeExpressions(ff).getValue();
if (contentType != null) { if (contentType != null) {
objectMetadata.setContentType(contentType); objectMetadata.setContentType(contentType);
attributes.put(S3_CONTENT_TYPE, contentType);
} }
final String expirationRule = context.getProperty(EXPIRATION_RULE_ID) final String expirationRule = context.getProperty(EXPIRATION_RULE_ID)
@ -882,6 +883,7 @@ public class PutS3Object extends AbstractS3Processor {
_timestamp = timestamp; _timestamp = timestamp;
} }
@Override
public String toString() { public String toString() {
StringBuilder buf = new StringBuilder(); StringBuilder buf = new StringBuilder();
buf.append(_uploadId).append(SEPARATOR) buf.append(_uploadId).append(SEPARATOR)