From d6dcc6571a484d251da0686a185b24e2ba1e8df2 Mon Sep 17 00:00:00 2001 From: Oleg Zhurakousky Date: Mon, 22 Nov 2010 09:41:39 -0500 Subject: [PATCH] INT-1614 fixed test xml files for SFTP, updated SFTP documentation --- docs/src/reference/docbook/ftp.xml | 3 +- docs/src/reference/docbook/sftp.xml | 41 +++++++++++-------- .../SftpInboundReceiveSample-ignored.xml | 4 +- 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/docs/src/reference/docbook/ftp.xml b/docs/src/reference/docbook/ftp.xml index b0e3561bbe..9a8262020a 100644 --- a/docs/src/reference/docbook/ftp.xml +++ b/docs/src/reference/docbook/ftp.xml @@ -105,7 +105,8 @@ xsi:schemaLocation="http://www.springframework.org/schema/integration/ftp As you can see form the configuration above you can configure FTP Inbound Channel Adapter via inbound-channel-adapter element while also providing values for various attributes such as local-working-directory, filename-pattern (based on simple pattern matching - not regex) and of course the reference to a session-factory. - + + Some times file filtering based on the simple pattern specified via filename-pattern attribute might not be sufficient enough. If this is the case, you can use filename-regex attribute to specify Regular expression (e.g. filename-regex=".*\.test$"). And of course if you need complete control you can use filter diff --git a/docs/src/reference/docbook/sftp.xml b/docs/src/reference/docbook/sftp.xml index 01f322129f..1748ad669c 100644 --- a/docs/src/reference/docbook/sftp.xml +++ b/docs/src/reference/docbook/sftp.xml @@ -63,21 +63,31 @@ xsi:schemaLocation="http://www.springframework.org/schema/integration/sftp + local-directory="file:target/foo" + auto-create-local-directory="true" + delete-remote-files="false"> ]]> As you can see form the configuration above you can configure SFTP Inbound Channel Adapter via - inbound-channel-adapter element while also providing values for various attributes such as local-directory-path + inbound-channel-adapter element while also providing values for various attributes such as local-directory - where files are going to be transfered TO and remote-directory - the remote source directory as well as other attributes including session-factory which we configured earlier. - Please refer to the schema for more details on these attributes. + + + Some times file filtering based on the simple pattern specified via filename-pattern attribute might not be + sufficient enough. If this is the case, you can use filename-regex attribute to specify Regular expression + (e.g. filename-regex=".*\.test$"). And of course if you need complete control you can use filter + attribute and provide reference to a custom implementation of the + org.springframework.integration.file.filters.FileListFilter - a strategy interface for filtering a + group of files. - + + Please refer to the schema for more details on these attributes. + + It is also important to understand that SFTP Inbound Channel Adapter is a polling consumer and therefore you must configure a poller (global or local) @@ -85,16 +95,16 @@ xsi:schemaLocation="http://www.springframework.org/schema/integration/sftp payload will be generated and sent to the channel identified with channel attribute. - File Filtering and Large Files + More on File Filtering and Large Files Some times the file that just appeared in the monitored (remote) directory is not complete. Typically such file will be written with some temporary extension (e.g., foo.txt.writing) and then renamed after the writing process finished. As a user in most cases you are only interested in files that are complete and would like to filter only files that are complete. - To handle these scenarios Spring Integration SFTP support allows you to configure custom filters that will filter out only - the files that you need. The filter is based on org.springframework.integration.file.filters.FileListFilter interface. - We also provide a convenient Regex-based implementation org.springframework.integration.sftp.filters.SftpPatternMatchingFileListFilter. - Once configured all you need is include such filter in your adapter via 'filter' attribute. + To handle these scenarios use filtering support provided via filename-pattern, filename-regex + and filter attributes. We also provide a convenient Regex-based implementation + org.springframework.integration.sftp.filters.SftpPatternMatchingFileListFilter. + Once configured all you need is include such filter in your adapter via filter attribute. ]]> - - As an added convenience you may also use filename-pattern attribute instead of the explicit filter - configuration where you'll provide the filtering expression (Regex) - - @@ -127,7 +132,7 @@ xsi:schemaLocation="http://www.springframework.org/schema/integration/sftp 1) java.io.File - the actual file object; 2) byte[] - byte array that represents the file contents; 3) java.lang.String - represents the file contents. - + delete-remote-files="false" + filename-regex=".*\.test$">