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
FieldsFields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
logger, PARSER, targetFields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTEFields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedFileInboundChannelAdapterSpec(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 anIgnoreHiddenFileListFilterifignoreHidden == true.locker(FileLocker locker) Set aFileLockerto be used to guard files against duplicate processing.Configure anNioFileLocker.patternFilter(String pattern) Configure aSimplePatternFileListFilter.preventDuplicates(boolean preventDuplicates) Configure anAcceptOnceFileListFilterifpreventDuplicates == true, otherwise -AcceptAllFileListFilter.recursive(boolean recursive) A convenient flag to determine if target message source should use aRecursiveDirectoryScanneror 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 thisFileReadingMessageSourceto use its internalWatchServicedirectory scanner.watchDirPredicate(Predicate<Path> watchDirPredicate) Set aPredicateto check if it is eligible forWatchService.watchEvents(FileReadingMessageSource.WatchEventType... watchEvents) TheWatchServiceevent types.watchMaxDepth(int watchMaxDepth) Set a depth for files walk API.Methods inherited from class org.springframework.integration.dsl.MessageSourceSpec
messageHeadersMethods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec
_this, afterPropertiesSet, destroy, doGet, get, getId, getObject, getObjectType, getPhase, id, isAutoStartup, isRunning, start, stop, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 aRecursiveDirectoryScanneror 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 tofalseand 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- theFunctionfor files filtering.- Returns:
- the spec.
- See Also:
-
preventDuplicates
Configure anAcceptOnceFileListFilterifpreventDuplicates == true, otherwise -AcceptAllFileListFilter.- Parameters:
preventDuplicates- true to configure anAcceptOnceFileListFilter.- Returns:
- the spec.
-
ignoreHidden
Configure anIgnoreHiddenFileListFilterifignoreHidden == 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 aFileLockerto 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 thisFileReadingMessageSourceto use its internalWatchServicedirectory scanner.- Parameters:
useWatchService- thebooleanflag 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 aPredicateto check if it is eligible forWatchService.- Parameters:
watchDirPredicate- thePredicateto check dirs for walking.- Returns:
- the spec.
- Since:
- 6.1
- See Also:
-
getComponentsToRegister
- Specified by:
getComponentsToRegisterin interfaceComponentsRegistration
-