fixing citations.
This commit is contained in:
@@ -21,6 +21,7 @@ package org.springframework.integration.file.entries;
|
||||
* Simple NOOP implementation for {@link org.springframework.integration.file.entries.EntryListFilter} implementation.
|
||||
* Suitable as a default in implementations.
|
||||
*
|
||||
* @author Iwein Fuld
|
||||
* @author Josh Long
|
||||
* @param <T>
|
||||
*/
|
||||
|
||||
@@ -20,7 +20,15 @@ import org.springframework.util.Assert;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
* Simple {@link org.springframework.integration.file.entries.EntryListFilter} that predicates its matches
|
||||
* against any of many configured {@link org.springframework.integration.file.entries.EntryListFilter}
|
||||
*
|
||||
* @author Iwein Fuld
|
||||
* @author Josh Long
|
||||
*
|
||||
* @param <T>
|
||||
*/
|
||||
public class CompositeEntryListFilter<T> implements EntryListFilter<T> {
|
||||
private final Set<EntryListFilter<T>> fileFilters;
|
||||
|
||||
|
||||
@@ -23,11 +23,12 @@ import java.util.regex.Pattern;
|
||||
|
||||
|
||||
/**
|
||||
* <emphasis>experimental</emphasis>
|
||||
* <p/>
|
||||
*
|
||||
*
|
||||
* Filters a listing of entries (T) by qualifying their 'name' (as determined by {@link org.springframework.integration.file.entries.EntryNamer})
|
||||
* against a regular expression (an instance of {@link java.util.regex.Pattern})
|
||||
*
|
||||
* @author Iwein Fuld
|
||||
* @author Josh Long
|
||||
* @param <T> the type of entry
|
||||
*/
|
||||
@@ -59,7 +60,7 @@ public class PatternMatchingEntryListFilter<T> extends AbstractEntryListFilter<T
|
||||
this.pattern = Pattern.compile(this.patternExpression);
|
||||
}
|
||||
Assert.notNull(this.entryNamer, "'entryNamer' must not be null!");
|
||||
Assert.notNull(this.pattern, "'pattern' mustn't be null!");
|
||||
Assert.notNull(this.pattern, "'pattern' must not be null!");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -14,8 +14,16 @@ import java.io.IOException;
|
||||
import java.net.SocketException;
|
||||
|
||||
|
||||
abstract public class AbstractFtpClientFactory<T extends FTPClient>
|
||||
implements FtpClientFactory<T> {
|
||||
/**
|
||||
*
|
||||
* base class for the other {@link org.springframework.integration.ftp.FtpClientFactory} implementations.
|
||||
* Most of this came out of the {@link DefaultFtpClientFactory} and was refactored into a base class
|
||||
*
|
||||
* @author Iwein Fuld
|
||||
*
|
||||
* @param <T>
|
||||
*/
|
||||
abstract public class AbstractFtpClientFactory<T extends FTPClient> implements FtpClientFactory<T> {
|
||||
private static final Log logger = LogFactory.getLog(FtpClientFactory.class);
|
||||
private static final String DEFAULT_REMOTE_WORKING_DIRECTORY = "/";
|
||||
protected FTPClientConfig config;
|
||||
|
||||
@@ -19,9 +19,10 @@ import java.util.Properties;
|
||||
|
||||
|
||||
/**
|
||||
* provides a working FTPS implementation
|
||||
*
|
||||
* provides a working FTPS implementation. Based heavily on {@link org.springframework.integration.ftp.DefaultFtpClientFactory}
|
||||
*
|
||||
* @author Josh Long
|
||||
* @author Iwein Fuld
|
||||
*/
|
||||
public class DefaultFtpsClientFactory extends AbstractFtpClientFactory<FTPSClient> {
|
||||
private Boolean useClientMode;
|
||||
|
||||
@@ -21,6 +21,7 @@ import java.util.Collection;
|
||||
/**
|
||||
* An FTP-adapter implementation of {@link org.springframework.integration.file.AbstractInboundRemoteFileSystemSychronizer}
|
||||
*
|
||||
* @author Iwein Fuld
|
||||
* @author Josh Long
|
||||
*/
|
||||
public class FtpInboundRemoteFileSystemSynchronizer
|
||||
|
||||
@@ -7,6 +7,7 @@ import org.springframework.integration.file.AbstractInboundRemoteFileSystemSynch
|
||||
/**
|
||||
* a {@link org.springframework.integration.core.MessageSource} implementation for FTP
|
||||
*
|
||||
* @author Iwein Fuld
|
||||
* @author Josh Long
|
||||
*/
|
||||
public class FtpInboundRemoteFileSystemSynchronizingMessageSource
|
||||
|
||||
@@ -20,6 +20,7 @@ import java.io.File;
|
||||
/**
|
||||
* Factory to make building the namespace easier
|
||||
*
|
||||
* @author Iwein Fuld
|
||||
* @author Josh Long
|
||||
*/
|
||||
public class FtpRemoteFileSystemSynchronizingMessageSourceFactoryBean
|
||||
|
||||
@@ -13,6 +13,7 @@ import org.springframework.core.io.ResourceLoader;
|
||||
/**
|
||||
* A factory bean implementation that handles constructing an outbound FTP adapter.
|
||||
*
|
||||
* @author Iwein Fuld
|
||||
* @author Josh Long
|
||||
*/
|
||||
public class FtpSendingMessageHandlerFactoryBean extends AbstractFactoryBean<FtpSendingMessageHandler>
|
||||
|
||||
@@ -4,8 +4,15 @@ import javax.net.ssl.KeyManager;
|
||||
import javax.net.ssl.TrustManager;
|
||||
|
||||
|
||||
public class FtpsSendingMessageHandlerFactoryBean
|
||||
extends FtpSendingMessageHandlerFactoryBean {
|
||||
/**
|
||||
* Sends files to a remote FTPS file system. Based heavily on {@link org.springframework.integration.ftp.FtpSendingMessageHandler}
|
||||
*
|
||||
* @author Josh Long
|
||||
* @author Iwein Fuld
|
||||
*/
|
||||
|
||||
public class FtpsSendingMessageHandlerFactoryBean extends FtpSendingMessageHandlerFactoryBean {
|
||||
|
||||
/**
|
||||
* Sets whether the connection is implicit. Local testing reveals this to be a good choice.
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
package org.springframework.integration.ftp.impl;
|
||||
|
||||
import org.apache.commons.lang.SystemUtils;
|
||||
import org.apache.commons.net.ftp.FTP;
|
||||
import org.apache.commons.net.ftp.FTPClient;
|
||||
import org.apache.commons.net.ftp.FTPFile;
|
||||
|
||||
import org.springframework.beans.factory.config.AbstractFactoryBean;
|
||||
|
||||
import org.springframework.context.ResourceLoaderAware;
|
||||
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.core.io.ResourceEditor;
|
||||
import org.springframework.core.io.ResourceLoader;
|
||||
|
||||
import org.springframework.integration.file.entries.CompositeEntryListFilter;
|
||||
import org.springframework.integration.file.entries.EntryListFilter;
|
||||
import org.springframework.integration.file.entries.PatternMatchingEntryListFilter;
|
||||
import org.springframework.integration.ftp.*;
|
||||
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.net.ssl.KeyManager;
|
||||
import javax.net.ssl.TrustManager;
|
||||
|
||||
|
||||
/**
|
||||
* Factory to make building the namespace easier
|
||||
*
|
||||
* @author Iwein Fuld
|
||||
* @author Josh Long
|
||||
*/
|
||||
public class FtpsRemoteFileSystemSynchronizingMessageSourceFactoryBean extends FtpRemoteFileSystemSynchronizingMessageSourceFactoryBean {
|
||||
/**
|
||||
* Sets whether the connection is implicit. Local testing reveals this to be a good choice.
|
||||
*/
|
||||
protected volatile Boolean implicit = Boolean.FALSE;
|
||||
|
||||
/**
|
||||
* "TLS" or "SSL"
|
||||
*/
|
||||
protected volatile String protocol;
|
||||
|
||||
/**
|
||||
* "P"
|
||||
*/
|
||||
protected volatile String prot;
|
||||
private KeyManager keyManager;
|
||||
private TrustManager trustManager;
|
||||
protected volatile String authValue;
|
||||
private Boolean sessionCreation;
|
||||
private Boolean useClientMode;
|
||||
private Boolean needClientAuth;
|
||||
private Boolean wantsClientAuth;
|
||||
private String[] cipherSuites;
|
||||
|
||||
public FtpsRemoteFileSystemSynchronizingMessageSourceFactoryBean() {
|
||||
this.defaultFtpInboundFolderName = "ftpsInbound";
|
||||
this.clientMode = FTPClient.PASSIVE_LOCAL_DATA_CONNECTION_MODE;
|
||||
}
|
||||
|
||||
public void setKeyManager(KeyManager keyManager) {
|
||||
this.keyManager = keyManager;
|
||||
}
|
||||
|
||||
public void setTrustManager(TrustManager trustManager) {
|
||||
this.trustManager = trustManager;
|
||||
}
|
||||
|
||||
public void setImplicit(Boolean implicit) {
|
||||
this.implicit = implicit;
|
||||
}
|
||||
|
||||
public void setProtocol(String protocol) {
|
||||
this.protocol = protocol;
|
||||
}
|
||||
|
||||
public void setProt(String prot) {
|
||||
this.prot = prot;
|
||||
}
|
||||
|
||||
public void setAuthValue(String authValue) {
|
||||
this.authValue = authValue;
|
||||
}
|
||||
|
||||
public void setSessionCreation(Boolean sessionCreation) {
|
||||
this.sessionCreation = sessionCreation;
|
||||
}
|
||||
|
||||
public void setUseClientMode(Boolean useClientMode) {
|
||||
this.useClientMode = useClientMode;
|
||||
}
|
||||
|
||||
public void setNeedClientAuth(Boolean needClientAuth) {
|
||||
this.needClientAuth = needClientAuth;
|
||||
}
|
||||
|
||||
public void setWantsClientAuth(Boolean wantsClientAuth) {
|
||||
this.wantsClientAuth = wantsClientAuth;
|
||||
}
|
||||
|
||||
protected AbstractFtpClientFactory defaultClientFactory()
|
||||
throws Exception {
|
||||
DefaultFtpsClientFactory factory = ClientFactorySupport.ftpsClientFactory(this.host, Integer.parseInt(this.port), this.remoteDirectory, this.username, this.password, this.fileType,
|
||||
this.clientMode, this.prot, this.protocol, this.authValue, this.implicit, this.trustManager, this.keyManager, this.sessionCreation, this.useClientMode, this.wantsClientAuth,
|
||||
this.needClientAuth, this.cipherSuites);
|
||||
|
||||
return factory;
|
||||
}
|
||||
|
||||
public void setCipherSuites(String[] cipherSuites) {
|
||||
this.cipherSuites = cipherSuites;
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,8 @@ import org.w3c.dom.Element;
|
||||
|
||||
|
||||
/**
|
||||
* Provides namespace support for using SFTP
|
||||
* Provides namespace support for using SFTP.
|
||||
* This is very largely based on the FTP support by Iwein Fuld.
|
||||
*
|
||||
* @author Josh Long
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user