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 FileListFilterFactoryBeanfileListFilterFactoryBean -
Constructor Summary
Constructors Modifier Constructor Description protectedFileInboundChannelAdapterSpec()protectedFileInboundChannelAdapterSpec(java.util.Comparator<java.io.File> receptionOrderComparator) -
Method Summary
Modifier and Type Method Description FileInboundChannelAdapterSpecautoCreateDirectory(boolean autoCreateDirectory)Specify whether to create the source directory automatically if it does not yet exist upon initialization.FileInboundChannelAdapterSpecfilter(FileListFilter<java.io.File> filter)Configure the filter.FileInboundChannelAdapterSpecfilterExpression(java.lang.String expression)Configure theExpressionFileListFilter.FileInboundChannelAdapterSpecfilterFunction(java.util.function.Function<java.io.File,java.lang.Boolean> filterFunction)Configure theExpressionFileListFilter.java.util.Map<java.lang.Object,java.lang.String>getComponentsToRegister()FileInboundChannelAdapterSpecignoreHidden(boolean ignoreHidden)Configure anIgnoreHiddenFileListFilterifignoreHidden == true.FileInboundChannelAdapterSpeclocker(FileLocker locker)Set aFileLockerto be used to guard files against duplicate processing.FileInboundChannelAdapterSpecnioLocker()Configure anNioFileLocker.FileInboundChannelAdapterSpecpatternFilter(java.lang.String pattern)Configure aSimplePatternFileListFilter.FileInboundChannelAdapterSpecpreventDuplicates(boolean preventDuplicates)Configure anAcceptOnceFileListFilterifpreventDuplicates == true, otherwise -AcceptAllFileListFilter.FileInboundChannelAdapterSpecregexFilter(java.lang.String regex)Configure aRegexPatternFileListFilter.FileInboundChannelAdapterSpecscanEachPoll(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.FileInboundChannelAdapterSpecscanner(DirectoryScanner scanner)Specify a custom scanner.FileInboundChannelAdapterSpecuseWatchService(boolean useWatchService)Switch thisFileReadingMessageSourceto use its internalWatchServicedirectory scanner.FileInboundChannelAdapterSpecwatchEvents(FileReadingMessageSource.WatchEventType... watchEvents)TheWatchServiceevent 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
-
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 is true. If set to false 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- theFunctionfor files filtering.- Returns:
- the spec.
- See Also:
FileReadingMessageSource.setFilter(FileListFilter),ExpressionFileListFilter
-
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:
FileReadingMessageSource.setFilter(FileListFilter),filter(FileListFilter)
-
regexFilter
Configure aRegexPatternFileListFilter.- Parameters:
regex- The regex.- Returns:
- the spec.
- See Also:
FileReadingMessageSource.setFilter(FileListFilter),filter(FileListFilter)
-
locker
Set aFileLockerto 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 thisFileReadingMessageSourceto use its internalWatchServicedirectory scanner.- Parameters:
useWatchService- thebooleanflag 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:
getComponentsToRegisterin interfaceorg.springframework.integration.dsl.ComponentsRegistration
-