Class FileInboundChannelAdapterSpec
java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<T>
org.springframework.integration.dsl.IntegrationComponentSpec<S,H>
org.springframework.integration.dsl.MessageSourceSpec<FileInboundChannelAdapterSpec,FileReadingMessageSource>
org.springframework.integration.file.dsl.FileInboundChannelAdapterSpec
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanClassLoaderAware
,org.springframework.beans.factory.BeanFactoryAware
,org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.FactoryBean<FileReadingMessageSource>
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.Lifecycle
,org.springframework.context.Phased
,org.springframework.context.SmartLifecycle
,org.springframework.integration.dsl.ComponentsRegistration
public class FileInboundChannelAdapterSpec extends org.springframework.integration.dsl.MessageSourceSpec<FileInboundChannelAdapterSpec,FileReadingMessageSource> implements org.springframework.integration.dsl.ComponentsRegistration
A
MessageSourceSpec
for a FileReadingMessageSource
.- Since:
- 5.0
-
Field Summary
Fields Modifier and Type Field Description protected FileListFilterFactoryBean
fileListFilterFactoryBean
-
Constructor Summary
Constructors Modifier Constructor Description protected
FileInboundChannelAdapterSpec()
protected
FileInboundChannelAdapterSpec(java.util.Comparator<java.io.File> receptionOrderComparator)
-
Method Summary
Modifier and Type Method Description FileInboundChannelAdapterSpec
autoCreateDirectory(boolean autoCreateDirectory)
Specify whether to create the source directory automatically if it does not yet exist upon initialization.FileInboundChannelAdapterSpec
filter(FileListFilter<java.io.File> filter)
Configure the filter.FileInboundChannelAdapterSpec
filterExpression(java.lang.String expression)
Configure theExpressionFileListFilter
.FileInboundChannelAdapterSpec
filterFunction(java.util.function.Function<java.io.File,java.lang.Boolean> filterFunction)
Configure theExpressionFileListFilter
.java.util.Map<java.lang.Object,java.lang.String>
getComponentsToRegister()
FileInboundChannelAdapterSpec
ignoreHidden(boolean ignoreHidden)
Configure anIgnoreHiddenFileListFilter
ifignoreHidden == true
.FileInboundChannelAdapterSpec
locker(FileLocker locker)
Set aFileLocker
to be used to guard files against duplicate processing.FileInboundChannelAdapterSpec
nioLocker()
Configure anNioFileLocker
.FileInboundChannelAdapterSpec
patternFilter(java.lang.String pattern)
Configure aSimplePatternFileListFilter
.FileInboundChannelAdapterSpec
preventDuplicates(boolean preventDuplicates)
Configure anAcceptOnceFileListFilter
ifpreventDuplicates == true
, otherwise -AcceptAllFileListFilter
.FileInboundChannelAdapterSpec
recursive(boolean recursive)
A convenient flag to determine if target message source should use aRecursiveDirectoryScanner
or stay with a default one.FileInboundChannelAdapterSpec
regexFilter(java.lang.String regex)
Configure aRegexPatternFileListFilter
.FileInboundChannelAdapterSpec
scanEachPoll(boolean scanEachPoll)
Set this flag if you want to make sure the internal queue is refreshed with the latest content of the input directory on each poll.FileInboundChannelAdapterSpec
scanner(DirectoryScanner scanner)
Specify a custom scanner.FileInboundChannelAdapterSpec
useWatchService(boolean useWatchService)
Switch thisFileReadingMessageSource
to use its internalWatchService
directory scanner.FileInboundChannelAdapterSpec
watchEvents(FileReadingMessageSource.WatchEventType... watchEvents)
TheWatchService
event types.Methods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
_this, createInstance, destroyInstance, doGet, get, getId, getObjectType, getPhase, id, isAutoStartup, isRunning, start, stop, stop
-
Field Details
-
Constructor Details
-
FileInboundChannelAdapterSpec
protected FileInboundChannelAdapterSpec() -
FileInboundChannelAdapterSpec
protected FileInboundChannelAdapterSpec(java.util.Comparator<java.io.File> receptionOrderComparator)
-
-
Method Details
-
recursive
A convenient flag to determine if target message source should use aRecursiveDirectoryScanner
or stay with a default one.- Parameters:
recursive
- to set or not aRecursiveDirectoryScanner
.- Returns:
- the spec.
- Since:
- 5.5
- See Also:
RecursiveDirectoryScanner
-
scanner
Specify a custom scanner.- Parameters:
scanner
- the scanner.- Returns:
- the spec.
- See Also:
FileReadingMessageSource.setScanner(DirectoryScanner)
-
autoCreateDirectory
Specify whether to create the source directory automatically if it does not yet exist upon initialization. By default, this value istrue
. If set tofalse
and the source directory does not exist, an Exception will be thrown upon initialization.- Parameters:
autoCreateDirectory
- the autoCreateDirectory.- Returns:
- the spec.
- See Also:
FileReadingMessageSource.setAutoCreateDirectory(boolean)
-
filter
Configure the filter.- Parameters:
filter
- the filter.- Returns:
- the spec.
- See Also:
FileReadingMessageSource.setFilter(FileListFilter)
-
filterExpression
Configure theExpressionFileListFilter
.- Parameters:
expression
- the SpEL expression for files filtering.- Returns:
- the spec.
- See Also:
FileReadingMessageSource.setFilter(FileListFilter)
,ExpressionFileListFilter
-
filterFunction
public FileInboundChannelAdapterSpec filterFunction(java.util.function.Function<java.io.File,java.lang.Boolean> filterFunction)Configure theExpressionFileListFilter
.- Parameters:
filterFunction
- theFunction
for files filtering.- Returns:
- the spec.
- See Also:
FileReadingMessageSource.setFilter(FileListFilter)
,ExpressionFileListFilter
-
preventDuplicates
Configure anAcceptOnceFileListFilter
ifpreventDuplicates == true
, otherwise -AcceptAllFileListFilter
.- Parameters:
preventDuplicates
- true to configure anAcceptOnceFileListFilter
.- Returns:
- the spec.
-
ignoreHidden
Configure anIgnoreHiddenFileListFilter
ifignoreHidden == true
.- Parameters:
ignoreHidden
- true to configure anIgnoreHiddenFileListFilter
.- Returns:
- the spec.
-
patternFilter
Configure aSimplePatternFileListFilter
.- Parameters:
pattern
- The pattern.- Returns:
- the spec.
- See Also:
FileReadingMessageSource.setFilter(FileListFilter)
,filter(FileListFilter)
-
regexFilter
Configure aRegexPatternFileListFilter
.- Parameters:
regex
- The regex.- Returns:
- the spec.
- See Also:
FileReadingMessageSource.setFilter(FileListFilter)
,filter(FileListFilter)
-
locker
Set aFileLocker
to be used to guard files against duplicate processing.- Parameters:
locker
- the locker.- Returns:
- the spec.
- See Also:
FileReadingMessageSource.setLocker(FileLocker)
-
nioLocker
Configure anNioFileLocker
.- Returns:
- the spec.
- See Also:
locker(FileLocker)
-
scanEachPoll
Set this flag if you want to make sure the internal queue is refreshed with the latest content of the input directory on each poll.- Parameters:
scanEachPoll
- the scanEachPoll.- Returns:
- the spec.
- See Also:
FileReadingMessageSource.setScanEachPoll(boolean)
-
useWatchService
Switch thisFileReadingMessageSource
to use its internalWatchService
directory scanner.- Parameters:
useWatchService
- theboolean
flag to enable the use of aWatchService
.- Returns:
- the spec.
- See Also:
watchEvents(org.springframework.integration.file.FileReadingMessageSource.WatchEventType...)
,FileReadingMessageSource.setUseWatchService(boolean)
-
watchEvents
public FileInboundChannelAdapterSpec watchEvents(FileReadingMessageSource.WatchEventType... watchEvents)- Parameters:
watchEvents
- the set ofFileReadingMessageSource.WatchEventType
.- Returns:
- the spec.
- See Also:
useWatchService(boolean)
,FileReadingMessageSource.setWatchEvents(org.springframework.integration.file.FileReadingMessageSource.WatchEventType...)
-
getComponentsToRegister
public java.util.Map<java.lang.Object,java.lang.String> getComponentsToRegister()- Specified by:
getComponentsToRegister
in interfaceorg.springframework.integration.dsl.ComponentsRegistration
-