polishing
This commit is contained in:
@@ -175,7 +175,7 @@ xsi:schemaLocation="http://www.springframework.org/schema/integration/sftp
|
||||
<title>SFTP Outbound Gateway</title>
|
||||
|
||||
<para>
|
||||
The <emphasis>FTP Outbound Gateway</emphasis> provides a limited set of commands to interact with a remote FTP/FTPS server.
|
||||
The <emphasis>SFTP Outbound Gateway</emphasis> provides a limited set of commands to interact with a remote SFTP server.
|
||||
<para>
|
||||
Commands supported are:
|
||||
<itemizedlist>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
* Copyright 2002-2011 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.
|
||||
@@ -30,8 +30,8 @@ public abstract class FileHeaders {
|
||||
|
||||
public static final String ORIGINAL_FILE = PREFIX + "originalFile";
|
||||
|
||||
public static final String REMOTE_DIR = PREFIX + "remote_dir";
|
||||
public static final String REMOTE_DIR = PREFIX + "remoteDir";
|
||||
|
||||
public static final String REMOTE_FILE = PREFIX + "remote_file";
|
||||
public static final String REMOTE_FILE = PREFIX + "remoteFile";
|
||||
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ public abstract class AbstractRemoteFileOutboundGateway<F> extends AbstractReply
|
||||
}
|
||||
return results;
|
||||
} else {
|
||||
List<AbstractFileInfo<F>> canonicalFiles = this.asFileInFoList(lsFiles);
|
||||
List<AbstractFileInfo<F>> canonicalFiles = this.asFileInfoList(lsFiles);
|
||||
for (AbstractFileInfo<F> file : canonicalFiles) {
|
||||
file.setRemoteDir(dir);
|
||||
}
|
||||
@@ -318,7 +318,7 @@ public abstract class AbstractRemoteFileOutboundGateway<F> extends AbstractReply
|
||||
|
||||
abstract protected long getModified(F file);
|
||||
|
||||
abstract protected List<AbstractFileInfo<F>> asFileInFoList(Collection<F> files);
|
||||
abstract protected List<AbstractFileInfo<F>> asFileInfoList(Collection<F> files);
|
||||
|
||||
/**
|
||||
* @param options the options to set
|
||||
|
||||
@@ -428,7 +428,7 @@ class TestRemoteFileOutboundGateway extends AbstractRemoteFileOutboundGateway<Te
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<AbstractFileInfo<TestLsEntry>> asFileInFoList(
|
||||
protected List<AbstractFileInfo<TestLsEntry>> asFileInfoList(
|
||||
Collection<TestLsEntry> files) {
|
||||
return new ArrayList<AbstractFileInfo<TestLsEntry>>(files);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.ftp.gateway;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -28,7 +29,6 @@ import org.springframework.integration.ftp.session.FtpFileInfo;
|
||||
/**
|
||||
* @author Gary Russell
|
||||
* @since 2.1
|
||||
*
|
||||
*/
|
||||
public class FtpOutboundGateway extends AbstractRemoteFileOutboundGateway<FTPFile> {
|
||||
|
||||
@@ -58,8 +58,7 @@ public class FtpOutboundGateway extends AbstractRemoteFileOutboundGateway<FTPFil
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<AbstractFileInfo<FTPFile>> asFileInFoList(
|
||||
Collection<FTPFile> files) {
|
||||
protected List<AbstractFileInfo<FTPFile>> asFileInfoList(Collection<FTPFile> files) {
|
||||
List<AbstractFileInfo<FTPFile>> canonicalFiles = new ArrayList<AbstractFileInfo<FTPFile>>();
|
||||
for (FTPFile file : files) {
|
||||
canonicalFiles.add(new FtpFileInfo(file));
|
||||
|
||||
@@ -188,7 +188,7 @@ endpoint itself is a Polling Consumer for a channel with a queue.
|
||||
<xsd:element name="outbound-gateway">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
Builds an outbound gateway used to issue sftp commands.
|
||||
Builds an outbound gateway used to issue FTP commands.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:complexType>
|
||||
@@ -197,11 +197,11 @@ endpoint itself is a Polling Consumer for a channel with a queue.
|
||||
<xsd:annotation>
|
||||
<xsd:appinfo>
|
||||
<tool:annotation kind="ref">
|
||||
<tool:expected-type type="org.springframework.integration.sftp.session.SftpSessionFactory"/>
|
||||
<tool:expected-type type="org.springframework.integration.ftp.session.AbstractFtpSessionFactory"/>
|
||||
</tool:annotation>
|
||||
</xsd:appinfo>
|
||||
<xsd:documentation>
|
||||
Reference to a [org.springframework.integration.sftp.session.SftpSessionFactory] bean.
|
||||
Reference to a [org.springframework.integration.ftp.session.AbstractFtpSessionFactory] bean.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
@@ -215,14 +215,14 @@ endpoint itself is a Polling Consumer for a channel with a queue.
|
||||
<xsd:attribute name="command" use="required" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
sftp command - ls, get or rm
|
||||
FTP command - ls, get or rm
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="command-options" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
sftp command options; for ls, -1 means just return the file names (otherwise file
|
||||
FTP command options; for ls, -1 means just return the file names (otherwise file
|
||||
metadata is returned, -dirs means include directories (not included by default),
|
||||
-links means include links (not included by default); for get, -P means preserve
|
||||
timestamp from remote file.
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.sftp.gateway;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -29,7 +30,6 @@ import com.jcraft.jsch.ChannelSftp.LsEntry;
|
||||
/**
|
||||
* @author Gary Russell
|
||||
* @since 2.0.4
|
||||
*
|
||||
*/
|
||||
public class SftpOutboundGateway extends AbstractRemoteFileOutboundGateway<LsEntry> {
|
||||
|
||||
@@ -39,8 +39,7 @@ public class SftpOutboundGateway extends AbstractRemoteFileOutboundGateway<LsEnt
|
||||
* @param options
|
||||
* @param expression
|
||||
*/
|
||||
public SftpOutboundGateway(SessionFactory sessionFactory, String command,
|
||||
String expression) {
|
||||
public SftpOutboundGateway(SessionFactory sessionFactory, String command, String expression) {
|
||||
super(sessionFactory, command, expression);
|
||||
}
|
||||
|
||||
@@ -60,7 +59,7 @@ public class SftpOutboundGateway extends AbstractRemoteFileOutboundGateway<LsEnt
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<AbstractFileInfo<LsEntry>> asFileInFoList(Collection<LsEntry> files) {
|
||||
protected List<AbstractFileInfo<LsEntry>> asFileInfoList(Collection<LsEntry> files) {
|
||||
List<AbstractFileInfo<LsEntry>> canonicalFiles = new ArrayList<AbstractFileInfo<LsEntry>>();
|
||||
for (LsEntry file : files) {
|
||||
canonicalFiles.add(new SftpFileInfo(file));
|
||||
|
||||
Reference in New Issue
Block a user