public class AmazonS3MessageHandler
extends org.springframework.integration.handler.AbstractMessageHandler
| Constructor and Description |
|---|
AmazonS3MessageHandler(AWSCredentials credentials,
AmazonS3Operations operations)
The constructor that initializes
AmazonS3MessageHandler with the provided
implementation of AmazonS3Operations and using the provided AWSCredentials |
| Modifier and Type | Method and Description |
|---|---|
protected void |
handleMessageInternal(org.springframework.integration.Message<?> message)
The handler implementation for the Amazon S3 used to put objects in the remote AWS S3 bucket
the message should contain a valid payload of type
File, InputStream,
byte[] or String. |
protected void |
onInit() |
void |
setBucket(java.lang.String bucket)
Sets the S3 Bucket to which the files are to be uploaded
|
void |
setCharset(java.lang.String charset)
Sets the charset for the String payload received
|
void |
setFileNameGenerator(FileNameGenerationStrategy fileNameGenerator)
Sets the file name generation strategy
|
void |
setRemoteDirectoryExpression(org.springframework.expression.Expression expression)
Sets the directory evaluating expression for finding the remote directory in S3
|
getComponentType, getOrder, handleMessage, setOrder, setShouldTrackafterPropertiesSet, getBeanFactory, getComponentName, getConversionService, getTaskScheduler, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toStringpublic AmazonS3MessageHandler(AWSCredentials credentials, AmazonS3Operations operations)
AmazonS3MessageHandler with the provided
implementation of AmazonS3Operations and using the provided AWSCredentialscredentials - operations - protected void onInit()
throws java.lang.Exception
onInit in class org.springframework.integration.context.IntegrationObjectSupportjava.lang.Exceptionprotected void handleMessageInternal(org.springframework.integration.Message<?> message)
throws java.lang.Exception
File, InputStream,
byte[] or String. Various predetermined headers as defined in AmazonS3MessageHeaders
are extracted from the message and an AmazonS3Object is constructed that is provided to
the AmazonS3Operations implementation to be uploaded in S3.handleMessageInternal in class org.springframework.integration.handler.AbstractMessageHandlermessage - java.lang.Exceptionpublic void setCharset(java.lang.String charset)
charset - public void setBucket(java.lang.String bucket)
bucket - public void setRemoteDirectoryExpression(org.springframework.expression.Expression expression)
expression - public void setFileNameGenerator(FileNameGenerationStrategy fileNameGenerator)
fileNameGenerator -