Class AbstractRemoteFileStreamingMessageSource<F>
java.lang.Object
org.springframework.integration.util.AbstractExpressionEvaluator
org.springframework.integration.endpoint.AbstractMessageSource<T>
org.springframework.integration.endpoint.AbstractFetchLimitingMessageSource<java.io.InputStream>
org.springframework.integration.file.remote.AbstractRemoteFileStreamingMessageSource<F>
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.context.Lifecycle,org.springframework.integration.core.MessageSource<java.io.InputStream>,org.springframework.integration.IntegrationPattern,org.springframework.integration.support.context.NamedComponent,org.springframework.integration.support.management.IntegrationInboundManagement,org.springframework.integration.support.management.IntegrationManagement,org.springframework.integration.support.management.ManageableLifecycle,org.springframework.integration.support.management.MessageSourceManagement
public abstract class AbstractRemoteFileStreamingMessageSource<F>
extends org.springframework.integration.endpoint.AbstractFetchLimitingMessageSource<java.io.InputStream>
implements org.springframework.integration.support.management.ManageableLifecycle
A message source that produces a message with an
InputStream payload
referencing a remote file.- Since:
- 4.3
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractRemoteFileStreamingMessageSource(RemoteFileTemplate<F> template, java.util.Comparator<F> comparator) -
Method Summary
Modifier and Type Method Description protected abstract java.util.List<AbstractFileInfo<F>>asFileInfoList(java.util.Collection<F> files)protected voiddoInit()Subclasses can override to perform initialization - called fromInitializingBean.afterPropertiesSet().protected java.lang.ObjectdoReceive(int maxFetchSize)protected voiddoSetFilter(FileListFilter<F> filterToSet)protected RemoteFileTemplate<F>getRemoteFileTemplate()protected abstract booleanisDirectory(F file)booleanisRunning()voidonInit()protected AbstractFileInfo<F>poll()protected java.lang.StringremotePath(AbstractFileInfo<F> file)protected voidrollbackFromFileToListEnd(java.util.List<F> filteredFiles, F file)voidsetFileInfoJson(boolean fileInfoJson)Set to false to add theFileHeaders.REMOTE_FILE_INFOheader to the rawFileInfo.voidsetFilter(FileListFilter<F> filter)Set the filter to be applied to the remote files before transferring.voidsetRemoteDirectory(java.lang.String remoteDirectory)Specify the full path to the remote directory.voidsetRemoteDirectoryExpression(org.springframework.expression.Expression remoteDirectoryExpression)Specify an expression that evaluates to the full path to the remote directory.voidsetRemoteFileSeparator(java.lang.String remoteFileSeparator)Set the remote file separator; default '/'voidstart()voidstop()Methods inherited from class org.springframework.integration.endpoint.AbstractFetchLimitingMessageSource
doReceive, getMaxFetchSize, setMaxFetchSizeMethods inherited from class org.springframework.integration.endpoint.AbstractMessageSource
buildMessage, destroy, getBeanName, getComponentName, getManagedName, getManagedType, getOverrides, isLoggingEnabled, receive, registerMetricsCaptor, setBeanName, setHeaderExpressions, setLoggingEnabled, setManagedName, setManagedTypeMethods inherited from class org.springframework.integration.util.AbstractExpressionEvaluator
afterPropertiesSet, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, getBeanFactory, getEvaluationContext, getEvaluationContext, getMessageBuilderFactory, setBeanFactory, setConversionServiceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getThisAs
-
Constructor Details
-
AbstractRemoteFileStreamingMessageSource
protected AbstractRemoteFileStreamingMessageSource(RemoteFileTemplate<F> template, @Nullable java.util.Comparator<F> comparator)
-
-
Method Details
-
setRemoteDirectory
public void setRemoteDirectory(java.lang.String remoteDirectory)Specify the full path to the remote directory.- Parameters:
remoteDirectory- The remote directory.
-
setRemoteDirectoryExpression
public void setRemoteDirectoryExpression(org.springframework.expression.Expression remoteDirectoryExpression)Specify an expression that evaluates to the full path to the remote directory.- Parameters:
remoteDirectoryExpression- The remote directory expression.
-
setRemoteFileSeparator
public void setRemoteFileSeparator(java.lang.String remoteFileSeparator)Set the remote file separator; default '/'- Parameters:
remoteFileSeparator- the remote file separator.
-
setFilter
Set the filter to be applied to the remote files before transferring.- Parameters:
filter- the file list filter.
-
doSetFilter
-
setFileInfoJson
public void setFileInfoJson(boolean fileInfoJson)Set to false to add theFileHeaders.REMOTE_FILE_INFOheader to the rawFileInfo. Default is true meaning that common file information properties are provided in that header as JSON.- Parameters:
fileInfoJson- false to set the raw object.- Since:
- 5.0
-
getRemoteFileTemplate
-
onInit
public final void onInit()- Overrides:
onInitin classorg.springframework.integration.util.AbstractExpressionEvaluator
-
doInit
protected void doInit()Subclasses can override to perform initialization - called fromInitializingBean.afterPropertiesSet(). -
start
public void start()- Specified by:
startin interfaceorg.springframework.context.Lifecycle- Specified by:
startin interfaceorg.springframework.integration.support.management.ManageableLifecycle
-
stop
public void stop()- Specified by:
stopin interfaceorg.springframework.context.Lifecycle- Specified by:
stopin interfaceorg.springframework.integration.support.management.ManageableLifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceorg.springframework.context.Lifecycle- Specified by:
isRunningin interfaceorg.springframework.integration.support.management.ManageableLifecycle
-
doReceive
protected java.lang.Object doReceive(int maxFetchSize)- Specified by:
doReceivein classorg.springframework.integration.endpoint.AbstractFetchLimitingMessageSource<java.io.InputStream>
-
poll
-
remotePath
-
rollbackFromFileToListEnd
-
asFileInfoList
protected abstract java.util.List<AbstractFileInfo<F>> asFileInfoList(java.util.Collection<F> files) -
isDirectory
-