Class FileInboundChannelAdapterSpec
java.lang.Object
org.springframework.integration.dsl.IntegrationComponentSpec<FileInboundChannelAdapterSpec, FileReadingMessageSource>
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 SummaryFieldsFields inherited from class org.springframework.integration.dsl.IntegrationComponentSpeclogger, PARSER, targetFields inherited from interface org.springframework.beans.factory.FactoryBeanOBJECT_TYPE_ATTRIBUTEFields inherited from interface org.springframework.context.SmartLifecycleDEFAULT_PHASE
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedprotectedFileInboundChannelAdapterSpec(Comparator<File> receptionOrderComparator) 
- 
Method SummaryModifier 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.MessageSourceSpecmessageHeadersMethods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec_this, afterPropertiesSet, destroy, doGet, getId, getObject, getObjectType, getPhase, id, isAutoStartup, isRunning, start, stop, stopMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.beans.factory.FactoryBeanisSingleton
- 
Field Details- 
fileListFilterFactoryBean
 
- 
- 
Constructor Details- 
FileInboundChannelAdapterSpecprotected FileInboundChannelAdapterSpec()
- 
FileInboundChannelAdapterSpec
 
- 
- 
Method Details- 
recursiveA convenient flag to determine if target message source should use aRecursiveDirectoryScanneror stay with a default one.- Parameters:
- recursive- to set or not a- RecursiveDirectoryScanner.
- Returns:
- the spec.
- Since:
- 5.5
- See Also:
 
- 
scannerSpecify a custom scanner.- Parameters:
- scanner- the scanner.
- Returns:
- the spec.
- See Also:
 
- 
autoCreateDirectorySpecify 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:
 
- 
filterConfigure the filter.- Parameters:
- filter- the filter.
- Returns:
- the spec.
- See Also:
 
- 
filterExpressionConfigure theExpressionFileListFilter.- Parameters:
- expression- the SpEL expression for files filtering.
- Returns:
- the spec.
- See Also:
 
- 
filterFunctionConfigure theExpressionFileListFilter.- Parameters:
- filterFunction- the- Functionfor files filtering.
- Returns:
- the spec.
- See Also:
 
- 
preventDuplicatesConfigure anAcceptOnceFileListFilterifpreventDuplicates == true, otherwise -AcceptAllFileListFilter.- Parameters:
- preventDuplicates- true to configure an- AcceptOnceFileListFilter.
- Returns:
- the spec.
 
- 
ignoreHiddenConfigure anIgnoreHiddenFileListFilterifignoreHidden == true.- Parameters:
- ignoreHidden- true to configure an- IgnoreHiddenFileListFilter.
- Returns:
- the spec.
 
- 
patternFilterConfigure aSimplePatternFileListFilter.- Parameters:
- pattern- The pattern.
- Returns:
- the spec.
- See Also:
 
- 
regexFilterConfigure aRegexPatternFileListFilter.- Parameters:
- regex- The regex.
- Returns:
- the spec.
- See Also:
 
- 
lockerSet aFileLockerto be used to guard files against duplicate processing.- Parameters:
- locker- the locker.
- Returns:
- the spec.
- See Also:
 
- 
nioLockerConfigure anNioFileLocker.- Returns:
- the spec.
- See Also:
 
- 
scanEachPollSet 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:
 
- 
useWatchServiceSwitch thisFileReadingMessageSourceto use its internalWatchServicedirectory scanner.- Parameters:
- useWatchService- the- booleanflag to enable the use of a- WatchService.
- Returns:
- the spec.
- See Also:
 
- 
watchEventspublic FileInboundChannelAdapterSpec watchEvents(FileReadingMessageSource.WatchEventType... watchEvents) - Parameters:
- watchEvents- the set of- FileReadingMessageSource.WatchEventType.
- Returns:
- the spec.
- See Also:
 
- 
watchMaxDepthSet a depth for files walk API.- Parameters:
- watchMaxDepth- the depth for files walk.
- Returns:
- the spec.
- Since:
- 6.1
- See Also:
 
- 
watchDirPredicateSet aPredicateto check if it is eligible forWatchService.- Parameters:
- watchDirPredicate- the- Predicateto check dirs for walking.
- Returns:
- the spec.
- Since:
- 6.1
- See Also:
 
- 
getComponentsToRegister- Specified by:
- getComponentsToRegisterin interface- ComponentsRegistration
 
 
-