From 2cd1746eea93b39c8180e80f42704c1046eaade5 Mon Sep 17 00:00:00 2001 From: Oleg Zhurakousky Date: Mon, 22 Nov 2010 09:20:20 -0500 Subject: [PATCH] INT-1614 fixed test xml files and updated FTP documentation --- buildSrc | 2 +- docs/src/reference/docbook/ftp.xml | 72 +++++++++---------- ...boundChannelAdapterParserTests-context.xml | 6 ++ ...FtpInboundChannelAdapterSample-context.xml | 6 +- 4 files changed, 42 insertions(+), 44 deletions(-) diff --git a/buildSrc b/buildSrc index 55c3e5065f..436f2bee10 160000 --- a/buildSrc +++ b/buildSrc @@ -1 +1 @@ -Subproject commit 55c3e5065f378eaaeae5739ecf078c1f5815845d +Subproject commit 436f2bee1081ea775ac7c7f9565ed55bb6c6fd46 diff --git a/docs/src/reference/docbook/ftp.xml b/docs/src/reference/docbook/ftp.xml index d15acc05b1..b0e3561bbe 100644 --- a/docs/src/reference/docbook/ftp.xml +++ b/docs/src/reference/docbook/ftp.xml @@ -27,38 +27,29 @@ - - - - FTPS - -
- FTP Client Factory +
+ FTP Session Factory - Before configuring FTP adapters you must configure Ftp Client Factory. You configure - Ftp Client Factory via regular bean configuration by configuring org.springframework.integration.ftp.client.DefaultFtpClientFactory: + Before configuring FTP adapters you must configure Ftp Session Factory. You configure + Ftp Session Factory via regular bean configuration by configuring org.springframework.integration.ftp.session.DefaultFtpSessionFactory: Below is a basic configuration: - + - + - ]]> - For FTPS connections all you need to do is use org.springframework.integration.ftp.client.DefaultFtpsClientFactory. + For FTPS connections all you need to do is use org.springframework.integration.ftp.session.DefaultFtpsSessionFactory. Below is the complete configuration sample: @@ -68,7 +59,6 @@ xsi:schemaLocation="http://www.springframework.org/schema/integration/ftps - @@ -84,12 +74,12 @@ xsi:schemaLocation="http://www.springframework.org/schema/integration/ftps - Now all you need to do is inject these client factories into your adapters. Obviously the protocol (FTP or FTPS) adapter will use depends - on the type of client factory you are using. + Now all you need to do is inject these session factories into your adapters. Obviously the protocol (FTP or FTPS) adapter will + use depends on the type of session factory that's been injected into the adapter. - A more practical way to provide values for Ftp/Ftps Client Factory would be via Spring's property + A more practical way to provide values for Ftp/Ftps Session Factory would be via Spring's property placeholder (http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/beans.html#beans-factory-placeholderconfigurer) @@ -103,21 +93,29 @@ xsi:schemaLocation="http://www.springframework.org/schema/integration/ftps ]]> 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 (Regular expression) - and of course the reference to a client-factory. - Please refer to the schema for more details on these attributes. + 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 + 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 FTP Inbound Channel Adapter is a polling consumer and therefore you must configure a poller (global or local). @@ -125,20 +123,19 @@ xsi:schemaLocation="http://www.springframework.org/schema/integration/ftps 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 FTP 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.ftp.filters.FtpPatternMatchingFileListFilter. - 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.ftp.filters.FtpPatternMatchingFileListFilter. @@ -148,11 +145,6 @@ xsi:schemaLocation="http://www.springframework.org/schema/integration/ftps class="org.springframework.integration.ftp.filters.FtpPatternMatchingFileListFilt""> ]]> - -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) - -
@@ -169,7 +161,7 @@ As an added convenience you may also use filename-pattern attribute ]]> diff --git a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/config/FtpInboundChannelAdapterParserTests-context.xml b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/config/FtpInboundChannelAdapterParserTests-context.xml index 8103d67f4a..a3a2e0b599 100644 --- a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/config/FtpInboundChannelAdapterParserTests-context.xml +++ b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/config/FtpInboundChannelAdapterParserTests-context.xml @@ -22,6 +22,12 @@ + + + + - +