Class FileInboundChannelAdapterSpec
java.lang.Object
org.springframework.integration.dsl.IntegrationComponentSpec<S,H>
org.springframework.integration.dsl.MessageSourceSpec<FileInboundChannelAdapterSpec,FileReadingMessageSource>
org.springframework.integration.file.dsl.FileInboundChannelAdapterSpec
- All Implemented Interfaces:
DisposableBean
,FactoryBean<FileReadingMessageSource>
,InitializingBean
,Lifecycle
,Phased
,SmartLifecycle
,ComponentsRegistration
public class FileInboundChannelAdapterSpec
extends MessageSourceSpec<FileInboundChannelAdapterSpec,FileReadingMessageSource>
implements ComponentsRegistration
- Since:
- 5.0
- Author:
- Artem Bilan
-
Field Summary
Fields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
logger, PARSER, target
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE
-
Constructor Summary
ModifierConstructorDescriptionprotected
protected
FileInboundChannelAdapterSpec
(Comparator<File> receptionOrderComparator) -
Method Summary
Modifier and TypeMethodDescriptionautoCreateDirectory
(boolean autoCreateDirectory) Specify whether to create the source directory automatically if it does not yet exist upon initialization.filter
(FileListFilter<File> filter) Configure the filter.filterExpression
(String expression) Configure theExpressionFileListFilter
.filterFunction
(Function<File, Boolean> filterFunction) Configure theExpressionFileListFilter
.ignoreHidden
(boolean ignoreHidden) Configure anIgnoreHiddenFileListFilter
ifignoreHidden == true
.locker
(FileLocker locker) Set aFileLocker
to be used to guard files against duplicate processing.Configure anNioFileLocker
.patternFilter
(String pattern) Configure aSimplePatternFileListFilter
.preventDuplicates
(boolean preventDuplicates) Configure anAcceptOnceFileListFilter
ifpreventDuplicates == true
, otherwise -AcceptAllFileListFilter
.recursive
(boolean recursive) A convenient flag to determine if target message source should use aRecursiveDirectoryScanner
or stay with a default one.regexFilter
(String regex) Configure aRegexPatternFileListFilter
.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.scanner
(DirectoryScanner scanner) Specify a custom scanner.useWatchService
(boolean useWatchService) Switch thisFileReadingMessageSource
to use its internalWatchService
directory scanner.watchDirPredicate
(Predicate<Path> watchDirPredicate) Set aPredicate
to check if it is eligible forWatchService
.watchEvents
(FileReadingMessageSource.WatchEventType... watchEvents) TheWatchService
event types.watchMaxDepth
(int watchMaxDepth) Set a depth for files walk API.Methods inherited from class org.springframework.integration.dsl.MessageSourceSpec
messageHeaders
Methods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
_this, afterPropertiesSet, destroy, doGet, getId, getObject, getObjectType, getPhase, id, isAutoStartup, isRunning, start, stop, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.FactoryBean
isSingleton
-
Field Details
-
fileListFilterFactoryBean
-
-
Constructor Details
-
FileInboundChannelAdapterSpec
protected FileInboundChannelAdapterSpec() -
FileInboundChannelAdapterSpec
-
-
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:
-
scanner
Specify a custom scanner.- Parameters:
scanner
- the scanner.- Returns:
- the spec.
- See Also:
-
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:
-
filter
Configure the filter.- Parameters:
filter
- the filter.- Returns:
- the spec.
- See Also:
-
filterExpression
Configure theExpressionFileListFilter
.- Parameters:
expression
- the SpEL expression for files filtering.- Returns:
- the spec.
- See Also:
-
filterFunction
Configure theExpressionFileListFilter
.- Parameters:
filterFunction
- theFunction
for files filtering.- Returns:
- the spec.
- See Also:
-
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:
-
regexFilter
Configure aRegexPatternFileListFilter
.- Parameters:
regex
- The regex.- Returns:
- the spec.
- See Also:
-
locker
Set aFileLocker
to be used to guard files against duplicate processing.- Parameters:
locker
- the locker.- Returns:
- the spec.
- See Also:
-
nioLocker
Configure anNioFileLocker
.- Returns:
- the spec.
- See Also:
-
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:
-
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
public FileInboundChannelAdapterSpec watchEvents(FileReadingMessageSource.WatchEventType... watchEvents) - Parameters:
watchEvents
- the set ofFileReadingMessageSource.WatchEventType
.- Returns:
- the spec.
- See Also:
-
watchMaxDepth
Set a depth for files walk API.- Parameters:
watchMaxDepth
- the depth for files walk.- Returns:
- the spec.
- Since:
- 6.1
- See Also:
-
watchDirPredicate
Set aPredicate
to check if it is eligible forWatchService
.- Parameters:
watchDirPredicate
- thePredicate
to check dirs for walking.- Returns:
- the spec.
- Since:
- 6.1
- See Also:
-
getComponentsToRegister
- Specified by:
getComponentsToRegister
in interfaceComponentsRegistration
-