INT-3129: FTP local-filename-generator-expression
* Add `local-filename-generator-expression` attribute to FTP and SFTP Outbound Gateway * Refactoring for `(S)FtpOutboundGatewayParser` * Add `local-filename-generator-expression` tests * Add 'What's New' and attribute description JIRA: https://jira.springsource.org/browse/INT-3129 Polishing Doc Polishing Assert attribute is only set for get/mget Move tests to the get gateways
This commit is contained in:
committed by
Gary Russell
parent
bbf93e1385
commit
417c848c0b
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2011 the original author or authors.
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,28 +16,30 @@
|
||||
package org.springframework.integration.ftp.config;
|
||||
|
||||
import org.springframework.integration.file.config.AbstractRemoteFileOutboundGatewayParser;
|
||||
import org.springframework.integration.ftp.filters.FtpRegexPatternFileListFilter;
|
||||
import org.springframework.integration.ftp.filters.FtpSimplePatternFileListFilter;
|
||||
import org.springframework.integration.ftp.gateway.FtpOutboundGateway;
|
||||
|
||||
/**
|
||||
* @author Gary Russell
|
||||
* @author Artem Bilan
|
||||
* @since 2.1
|
||||
*
|
||||
*/
|
||||
public class FtpOutboundGatewayParser extends AbstractRemoteFileOutboundGatewayParser {
|
||||
|
||||
private static final String BASE_PACKAGE = "org.springframework.integration.ftp";
|
||||
|
||||
public String getGatewayClassName() {
|
||||
return BASE_PACKAGE + ".gateway.FtpOutboundGateway";
|
||||
return FtpOutboundGateway.class.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getSimplePatternFileListFilterClassname() {
|
||||
return BASE_PACKAGE + ".filters.FtpSimplePatternFileListFilter";
|
||||
protected String getSimplePatternFileListFilterClassName() {
|
||||
return FtpSimplePatternFileListFilter.class.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getRegexPatternFileListFilterClassname() {
|
||||
return BASE_PACKAGE + ".filters.FtpRegexPatternFileListFilter";
|
||||
protected String getRegexPatternFileListFilterClassName() {
|
||||
return FtpRegexPatternFileListFilter.class.getName();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -394,6 +394,21 @@
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="local-filename-generator-expression" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Allows you to provide a SpEL expression to
|
||||
generate the file name of
|
||||
the local (transferred) file. The root
|
||||
object of the SpEL
|
||||
evaluation is the request Message, but the name of the original
|
||||
remote file is also provided as the 'remoteFileName' variable.
|
||||
For example, a valid expression would be:
|
||||
"#remoteFileName.toUpperCase() + headers.foo".
|
||||
Only used with 'get' and 'mget' commands.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="local-directory" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
|
||||
Reference in New Issue
Block a user