Class FileTransferringMessageHandler<F>
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.file.remote.handler.FileTransferringMessageHandler<F>
- Type Parameters:
- F- the file type.
- All Implemented Interfaces:
- org.reactivestreams.Subscriber<Message<?>>,- Aware,- BeanFactoryAware,- BeanNameAware,- DisposableBean,- InitializingBean,- ApplicationContextAware,- Ordered,- ComponentSourceAware,- ExpressionCapable,- Orderable,- IntegrationPattern,- NamedComponent,- IntegrationManagement,- TrackableComponent,- MessageHandler,- reactor.core.CoreSubscriber<Message<?>>
- Direct Known Subclasses:
- FtpMessageHandler,- SftpMessageHandler,- SmbMessageHandler
A 
MessageHandler implementation that transfers files to a remote server.- Since:
- 2.0
- Author:
- Iwein Fuld, Mark Fisher, Josh Long, Oleg Zhurakousky, David Turanski, Gary Russell, Artem Bilan
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagementIntegrationManagement.ManagementOverrides
- 
Field SummaryFieldsFields inherited from class org.springframework.integration.context.IntegrationObjectSupportEXPRESSION_PARSER, loggerFields inherited from interface org.springframework.integration.support.management.IntegrationManagementMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEFields inherited from interface org.springframework.core.OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Constructor SummaryConstructorsConstructorDescriptionFileTransferringMessageHandler(RemoteFileTemplate<F> remoteFileTemplate) FileTransferringMessageHandler(RemoteFileTemplate<F> remoteFileTemplate, FileExistsMode mode) FileTransferringMessageHandler(SessionFactory<F> sessionFactory) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected voiddoChmod(RemoteFileTemplate<F> remoteFileTemplate, String path, int chmod) Set the mode on the remote file after transfer; the default implementation does nothing.protected Stringprotected voidhandleMessageInternal(Message<?> message) booleanprotected booleanprotected voidonInit()Subclasses may implement this for initialization logic.voidsetAutoCreateDirectory(boolean autoCreateDirectory) Abooleanflag to indicate automatically create the directory or not.voidsetCharset(String charset) Set the charset to use when converting String payloads to bytes as the content of the remote file.voidsetChmod(int chmod) Set the file permissions after uploading, e.g.voidsetChmodOctal(String chmod) String setter for Spring XML convenience.voidsetFileNameGenerator(FileNameGenerator fileNameGenerator) Set the file name generator used to generate the remote filename to be used when transferring files to the remote system.voidsetRemoteDirectoryExpression(Expression remoteDirectoryExpression) Specify a remote directory path SpEL expression.voidsetRemoteDirectoryExpressionString(String remoteDirectoryExpression) Specify a remote directory path SpEL expression.voidsetRemoteFileSeparator(String remoteFileSeparator) Specify a remote file separator symbol.voidsetTemporaryFileSuffix(String temporaryFileSuffix) Set the temporary suffix to use when transferring files to the remote system.voidsetTemporaryRemoteDirectoryExpression(Expression temporaryRemoteDirectoryExpression) Specify a remote directory path SpEL expression.voidsetTemporaryRemoteDirectoryExpressionString(String temporaryRemoteDirectoryExpression) Specify a remote directory path SpEL expression.voidsetUseTemporaryFileName(boolean useTemporaryFileName) Abooleanflag to use temporary files names or not.Methods inherited from class org.springframework.integration.handler.AbstractMessageHandlerhandleMessage, onComplete, onError, onNext, onSubscribe, setObservationConventionMethods inherited from class org.springframework.integration.handler.MessageHandlerSupportbuildSendTimer, destroy, getComponentType, getIntegrationPatternType, getManagedName, getManagedType, getMetricsCaptor, getObservationRegistry, getOrder, getOverrides, isLoggingEnabled, isObserved, registerMetricsCaptor, registerObservationRegistry, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrackMethods inherited from class org.springframework.integration.context.IntegrationObjectSupportafterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface reactor.core.CoreSubscribercurrentContextMethods inherited from interface org.springframework.integration.support.management.IntegrationManagementgetThisAsMethods inherited from interface org.springframework.integration.support.context.NamedComponentgetBeanName, getComponentName
- 
Field Details- 
remoteFileTemplate
 
- 
- 
Constructor Details- 
FileTransferringMessageHandler
- 
FileTransferringMessageHandler
- 
FileTransferringMessageHandlerpublic FileTransferringMessageHandler(RemoteFileTemplate<F> remoteFileTemplate, FileExistsMode mode) 
 
- 
- 
Method Details- 
setAutoCreateDirectorypublic void setAutoCreateDirectory(boolean autoCreateDirectory) Abooleanflag to indicate automatically create the directory or not.- Parameters:
- autoCreateDirectory- true to automatically create the directory.
- See Also:
 
- 
setRemoteFileSeparatorSpecify a remote file separator symbol.- Parameters:
- remoteFileSeparator- the remote file separator.
- See Also:
 
- 
setRemoteDirectoryExpressionSpecify a remote directory path SpEL expression.- Parameters:
- remoteDirectoryExpression- the remote directory expression
- See Also:
 
- 
setRemoteDirectoryExpressionStringSpecify a remote directory path SpEL expression.- Parameters:
- remoteDirectoryExpression- the remote directory expression
- Since:
- 4.3.13
- See Also:
 
- 
setTemporaryRemoteDirectoryExpressionSpecify a remote directory path SpEL expression.- Parameters:
- temporaryRemoteDirectoryExpression- the temporary remote directory expression
- See Also:
 
- 
setTemporaryRemoteDirectoryExpressionStringSpecify a remote directory path SpEL expression.- Parameters:
- temporaryRemoteDirectoryExpression- the temporary remote directory expression
- Since:
- 4.3.13
- See Also:
 
- 
getTemporaryFileSuffix
- 
isUseTemporaryFileNameprotected boolean isUseTemporaryFileName()
- 
setUseTemporaryFileNamepublic void setUseTemporaryFileName(boolean useTemporaryFileName) Abooleanflag to use temporary files names or not. Defaults totrue.- Parameters:
- useTemporaryFileName- true to use a temporary file name.
- See Also:
 
- 
setFileNameGeneratorSet the file name generator used to generate the remote filename to be used when transferring files to the remote system. DefaultDefaultFileNameGenerator.- Parameters:
- fileNameGenerator- the file name generator.
- See Also:
 
- 
setCharsetSet the charset to use when converting String payloads to bytes as the content of the remote file. DefaultUTF-8.- Parameters:
- charset- the charset.
- See Also:
 
- 
setTemporaryFileSuffixSet the temporary suffix to use when transferring files to the remote system. Default ".writing".- Parameters:
- temporaryFileSuffix- the temporary file suffix.
- See Also:
 
- 
setChmodOctalString setter for Spring XML convenience.- Parameters:
- chmod- permissions as an octal string e.g "600";
- Since:
- 4.3
- See Also:
 
- 
setChmodpublic void setChmod(int chmod) Set the file permissions after uploading, e.g. 0600 for owner read/write.- Parameters:
- chmod- the permissions.
- Since:
- 4.3
 
- 
isChmodCapablepublic boolean isChmodCapable()
- 
onInitprotected void onInit()Description copied from class:IntegrationObjectSupportSubclasses may implement this for initialization logic.- Overrides:
- onInitin class- IntegrationObjectSupport
 
- 
handleMessageInternal- Specified by:
- handleMessageInternalin class- AbstractMessageHandler
 
- 
doChmodSet the mode on the remote file after transfer; the default implementation does nothing.- Parameters:
- remoteFileTemplate- the remote file template.
- path- the path.
- chmod- the chmod to set.
- Since:
- 4.3
 
 
-