public class FileTransferringMessageHandler<F>
extends org.springframework.integration.handler.AbstractMessageHandler
MessageHandler implementation that transfers files to a remote server.| Modifier and Type | Field and Description |
|---|---|
protected RemoteFileTemplate<F> |
remoteFileTemplate |
EXPRESSION_PARSER, logger| 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,
java.lang.String path,
int chmod)
Set the mode on the remote file after transfer; the default implementation does
nothing.
|
protected java.lang.String |
getTemporaryFileSuffix() |
protected void |
handleMessageInternal(org.springframework.messaging.Message<?> message) |
boolean |
isChmodCapable() |
protected boolean |
isUseTemporaryFileName() |
protected void |
onInit() |
void |
setAutoCreateDirectory(boolean autoCreateDirectory)
A
boolean flag to indicate automatically create the directory or not. |
void |
setCharset(java.lang.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(java.lang.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(org.springframework.expression.Expression remoteDirectoryExpression)
Specify a remote directory path SpEL expression.
|
void |
setRemoteDirectoryExpressionString(java.lang.String remoteDirectoryExpression)
Specify a remote directory path SpEL expression.
|
void |
setRemoteFileSeparator(java.lang.String remoteFileSeparator)
Specify a remote file separator symbol.
|
void |
setTemporaryFileSuffix(java.lang.String temporaryFileSuffix)
Set the temporary suffix to use when transferring files to the remote system.
|
void |
setTemporaryRemoteDirectoryExpression(org.springframework.expression.Expression temporaryRemoteDirectoryExpression)
Specify a remote directory path SpEL expression.
|
void |
setTemporaryRemoteDirectoryExpressionString(java.lang.String temporaryRemoteDirectoryExpression)
Specify a remote directory path SpEL expression.
|
void |
setUseTemporaryFileName(boolean useTemporaryFileName)
A
boolean flag to use temporary files names or not. |
configureMetrics, getActiveCount, getActiveCountLong, getComponentType, getDuration, getErrorCount, getErrorCountLong, getHandleCount, getHandleCountLong, getManagedName, getManagedType, getMaxDuration, getMeanDuration, getMinDuration, getOrder, getOverrides, getStandardDeviationDuration, handleMessage, isCountsEnabled, isLoggingEnabled, isStatsEnabled, onComplete, onError, onNext, onSubscribe, registerMetricsCaptor, reset, setCountsEnabled, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, setStatsEnabledafterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, 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, waitprotected 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(java.lang.String remoteFileSeparator)
remoteFileSeparator - the remote file separator.RemoteFileTemplate.setRemoteFileSeparator(String)public void setRemoteDirectoryExpression(org.springframework.expression.Expression remoteDirectoryExpression)
remoteDirectoryExpression - the remote directory expressionRemoteFileTemplate.setRemoteDirectoryExpression(Expression)public void setRemoteDirectoryExpressionString(java.lang.String remoteDirectoryExpression)
remoteDirectoryExpression - the remote directory expressionsetRemoteDirectoryExpression(Expression)public void setTemporaryRemoteDirectoryExpression(org.springframework.expression.Expression temporaryRemoteDirectoryExpression)
temporaryRemoteDirectoryExpression - the temporary remote directory expressionRemoteFileTemplate.setTemporaryRemoteDirectoryExpression(Expression)public void setTemporaryRemoteDirectoryExpressionString(java.lang.String temporaryRemoteDirectoryExpression)
temporaryRemoteDirectoryExpression - the temporary remote directory expressionsetTemporaryRemoteDirectoryExpression(Expression)protected java.lang.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(java.lang.String charset)
UTF-8.charset - the charset.RemoteFileTemplate.setCharset(String)public void setTemporaryFileSuffix(java.lang.String temporaryFileSuffix)
temporaryFileSuffix - the temporary file suffix.RemoteFileTemplate.setTemporaryFileSuffix(String)public void setChmodOctal(java.lang.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()
throws java.lang.Exception
onInit in class org.springframework.integration.handler.AbstractMessageHandlerjava.lang.Exceptionprotected void handleMessageInternal(org.springframework.messaging.Message<?> message)
throws java.lang.Exception
handleMessageInternal in class org.springframework.integration.handler.AbstractMessageHandlerjava.lang.Exceptionprotected void doChmod(RemoteFileTemplate<F> remoteFileTemplate, java.lang.String path, int chmod)
remoteFileTemplate - the remote file template.path - the path.chmod - the chmod to set.