diff --git a/docs/src/reference/docbook/file.xml b/docs/src/reference/docbook/file.xml index 3ab3d97883..24a902bfbb 100644 --- a/docs/src/reference/docbook/file.xml +++ b/docs/src/reference/docbook/file.xml @@ -54,15 +54,16 @@ class="org.springframework.integration.file.FileReadingMessageSource" p:inputDirectory="${input.directory}" p:filter-ref="compositeFilter"/> - - - - - - - - - + + + + + + + + + ]]> @@ -74,12 +75,14 @@ xmlns:int="http://www.springframework.org/schema/integration" xmlns:int-file="http://www.springframework.org/schema/integration/file" xsi:schemaLocation="http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans-3.0.xsd - http://www.springframework.org/schema/integration - http://www.springframework.org/schema/integration/spring-integration-2.0.xsd - http://www.springframework.org/schema/integration/file - http://www.springframework.org/schema/integration/file/spring-integration-file-2.0.xsd"> + http://www.springframework.org/schema/beans/spring-beans-3.0.xsd + http://www.springframework.org/schema/integration + http://www.springframework.org/schema/integration/spring-integration-2.0.xsd + http://www.springframework.org/schema/integration/file + http://www.springframework.org/schema/integration/file/spring-integration-file-2.0.xsd"> ]]> + + Within this namespace you can reduce the FileReadingMessageSource and wrap it in an inbound Channel Adapter like this: ]]> + + The first channel adapter is relying on the default filter that just prevents duplication, the second is using a custom filter, the third is using the filename-pattern attribute to add an AntPathMatcher @@ -115,34 +120,33 @@ - ]]> - + ]]> + + A custom locker you can configure like this: - ]]> - + ]]> - - When a file inbound adapter is configured with a locker, it will take the responsibility to acquire a - lock before the file is allowed to be received. - It will not assume the responsibility to unlock the file. - If you have processed the file and keeping the locks hanging around you have a memory leak. If this is - a problem in your case you should call FileLocker.unlock(File file) yourself at the appropriate time. - + When a file inbound adapter is configured with a locker, it will take the responsibility to acquire a + lock before the file is allowed to be received. + It will not assume the responsibility to unlock the file. + If you have processed the file and keeping the locks hanging around you have a memory leak. If this is + a problem in your case you should call FileLocker.unlock(File file) yourself at the appropriate time. When filtering and locking files is not enough it might be needed to control the way files are listed entirely. To implement this type of requirement you can use an implementation of DirectoryScanner. This scanner allows you to determine entirely what files are listed each poll. This is also the interface that Spring Integration uses internally to wire FileListFilters FileLocker to the FileReadingMessageSource. - A custom DirectoryScanner can be injected into the <file:inbound-channel-adapter/> on the scanner + A custom DirectoryScanner can be injected into the <int-file:inbound-channel-adapter/> on the scanner attribute. - ]]> - + ]]> + + This gives you full freedom to choose the ordering, listing and locking strategies. @@ -176,11 +180,9 @@ directory="${output.directory}" delete-source-files="true"/>]]> - - The delete-source-files attribute will only have an effect if the inbound - Message has a File payload or if the FileHeaders.ORIGINAL_FILE header - value contains either the source File instance or a String representing the original file path. - + The delete-source-files attribute will only have an effect if the inbound + Message has a File payload or if the FileHeaders.ORIGINAL_FILE header + value contains either the source File instance or a String representing the original file path. @@ -234,6 +236,8 @@ ]]> + + The delete-files option signals to the transformer that it should delete the inbound File after the transformation is complete. This is in no way a replacement for using the AcceptOnceFileListFilter when the FileReadingMessageSource is being used in a