public class FileTransferringMessageHandler<F> extends AbstractMessageHandler
MessageHandler implementation that transfers files to a remote server.IntegrationManagement.ManagementOverrides| Modifier and Type | Field and Description |
|---|---|
protected RemoteFileTemplate<F> |
remoteFileTemplate |
EXPRESSION_PARSER, loggerMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| Constructor and Description |
|---|
FileTransferringMessageHandler(RemoteFileTemplate<F> remoteFileTemplate) |
FileTransferringMessageHandler(RemoteFileTemplate<F> remoteFileTemplate,
FileExistsMode mode) |
FileTransferringMessageHandler(SessionFactory<F> sessionFactory) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doChmod(RemoteFileTemplate<F> remoteFileTemplate,
String path,
int chmod)
Set the mode on the remote file after transfer; the default implementation does
nothing.
|
protected String |
getTemporaryFileSuffix() |
protected void |
handleMessageInternal(Message<?> message) |
boolean |
isChmodCapable() |
protected boolean |
isUseTemporaryFileName() |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
void |
setAutoCreateDirectory(boolean autoCreateDirectory)
A
boolean flag to indicate automatically create the directory or not. |
void |
setCharset(String charset)
Set the charset to use when converting String payloads to bytes as the content of the
remote file.
|
void |
setChmod(int chmod)
Set the file permissions after uploading, e.g.
|
void |
setChmodOctal(String chmod)
String setter for Spring XML convenience.
|
void |
setFileNameGenerator(FileNameGenerator fileNameGenerator)
Set the file name generator used to generate the remote filename to be used when
transferring files to the remote system.
|
void |
setRemoteDirectoryExpression(Expression remoteDirectoryExpression)
Specify a remote directory path SpEL expression.
|
void |
setRemoteDirectoryExpressionString(String remoteDirectoryExpression)
Specify a remote directory path SpEL expression.
|
void |
setRemoteFileSeparator(String remoteFileSeparator)
Specify a remote file separator symbol.
|
void |
setTemporaryFileSuffix(String temporaryFileSuffix)
Set the temporary suffix to use when transferring files to the remote system.
|
void |
setTemporaryRemoteDirectoryExpression(Expression temporaryRemoteDirectoryExpression)
Specify a remote directory path SpEL expression.
|
void |
setTemporaryRemoteDirectoryExpressionString(String temporaryRemoteDirectoryExpression)
Specify a remote directory path SpEL expression.
|
void |
setUseTemporaryFileName(boolean useTemporaryFileName)
A
boolean flag to use temporary files names or not. |
configureMetrics, destroy, getActiveCount, getActiveCountLong, getComponentType, getDuration, getErrorCount, getErrorCountLong, getHandleCount, getHandleCountLong, getManagedName, getManagedType, getMaxDuration, getMeanDuration, getMetricsCaptor, getMinDuration, getOrder, getOverrides, getStandardDeviationDuration, handleMessage, isCountsEnabled, isLoggingEnabled, isStatsEnabled, onComplete, onError, onNext, onSubscribe, registerMetricsCaptor, reset, setCountsEnabled, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, setStatsEnabledafterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waiterrorCount, handleCountgetBeanName, getComponentNameprotected final RemoteFileTemplate<F> remoteFileTemplate
public FileTransferringMessageHandler(SessionFactory<F> sessionFactory)
public FileTransferringMessageHandler(RemoteFileTemplate<F> remoteFileTemplate)
public FileTransferringMessageHandler(RemoteFileTemplate<F> remoteFileTemplate, FileExistsMode mode)
public void setAutoCreateDirectory(boolean autoCreateDirectory)
boolean flag to indicate automatically create the directory or not.autoCreateDirectory - true to automatically create the directory.RemoteFileTemplate.setAutoCreateDirectory(boolean)public void setRemoteFileSeparator(String remoteFileSeparator)
remoteFileSeparator - the remote file separator.RemoteFileTemplate.setRemoteFileSeparator(String)public void setRemoteDirectoryExpression(Expression remoteDirectoryExpression)
remoteDirectoryExpression - the remote directory expressionRemoteFileTemplate.setRemoteDirectoryExpression(Expression)public void setRemoteDirectoryExpressionString(String remoteDirectoryExpression)
remoteDirectoryExpression - the remote directory expressionsetRemoteDirectoryExpression(Expression)public void setTemporaryRemoteDirectoryExpression(Expression temporaryRemoteDirectoryExpression)
temporaryRemoteDirectoryExpression - the temporary remote directory expressionRemoteFileTemplate.setTemporaryRemoteDirectoryExpression(Expression)public void setTemporaryRemoteDirectoryExpressionString(String temporaryRemoteDirectoryExpression)
temporaryRemoteDirectoryExpression - the temporary remote directory expressionsetTemporaryRemoteDirectoryExpression(Expression)protected String getTemporaryFileSuffix()
protected boolean isUseTemporaryFileName()
public void setUseTemporaryFileName(boolean useTemporaryFileName)
boolean flag to use temporary files names or not.
Defaults to true.useTemporaryFileName - true to use a temporary file name.RemoteFileTemplate.setUseTemporaryFileName(boolean)public void setFileNameGenerator(FileNameGenerator fileNameGenerator)
DefaultFileNameGenerator.fileNameGenerator - the file name generator.RemoteFileTemplate.setFileNameGenerator(FileNameGenerator)public void setCharset(String charset)
UTF-8.charset - the charset.RemoteFileTemplate.setCharset(String)public void setTemporaryFileSuffix(String temporaryFileSuffix)
temporaryFileSuffix - the temporary file suffix.RemoteFileTemplate.setTemporaryFileSuffix(String)public void setChmodOctal(String chmod)
chmod - permissions as an octal string e.g "600";setChmod(int)public void setChmod(int chmod)
chmod - the permissions.public boolean isChmodCapable()
protected void onInit()
IntegrationObjectSupportonInit in class AbstractMessageHandlerprotected void handleMessageInternal(Message<?> message)
handleMessageInternal in class AbstractMessageHandlerprotected void doChmod(RemoteFileTemplate<F> remoteFileTemplate, String path, int chmod)
remoteFileTemplate - the remote file template.path - the path.chmod - the chmod to set.