INT-1638 removed unused dependencies form manifests, made minor refactoring to sftp and ftp modules to removed dependencies on commons-io and commons-lang

This commit is contained in:
Oleg Zhurakousky
2010-11-21 12:04:16 -05:00
parent 5bffcdc0df
commit 5a757523d1
7 changed files with 9 additions and 19 deletions

View File

@@ -24,8 +24,6 @@ import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.charset.Charset;
import org.apache.commons.lang.SystemUtils;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.Resource;
import org.springframework.expression.Expression;
@@ -62,7 +60,8 @@ public class FtpSendingMessageHandler extends AbstractMessageHandler {
private volatile File temporaryBufferFolderFile;
private volatile Resource temporaryBufferFolder = new FileSystemResource(SystemUtils.getJavaIoTmpDir());
private volatile Resource temporaryBufferFolder =
new FileSystemResource(System.getProperty("java.io.tmpdir"));
private volatile String charset = Charset.defaultCharset().name();

View File

@@ -5,7 +5,6 @@ Bundle-Version: ${version}
Bundle-ManifestVersion: 2
Import-Template:
org.apache.commons.logging;version="[1.1.1, 2.0.0)",
org.apache.commons.lang.*;version="[2.5.0, 3.0.0)",
org.apache.commons.net.*;version="[2.0.0, 3.0.0)",
org.springframework.integration.*;version="[2.0.0, 2.0.1)",
org.springframework.beans.*;version="[3.0.5, 4.0.0)",

View File

@@ -21,14 +21,13 @@ import java.io.FileOutputStream;
import java.io.InputStream;
import java.util.Collection;
import org.apache.commons.io.IOUtils;
import org.springframework.integration.MessagingException;
import org.springframework.integration.file.remote.session.Session;
import org.springframework.integration.file.remote.session.SessionFactory;
import org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer;
import org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizingMessageSource;
import org.springframework.util.Assert;
import org.springframework.util.FileCopyUtils;
import com.jcraft.jsch.ChannelSftp;
@@ -116,11 +115,11 @@ public class SftpInboundFileSynchronizer extends AbstractInboundFileSynchronizer
String remoteFqPath = this.remotePath + "/" + entry.getFilename();
in = session.get(remoteFqPath);
try {
IOUtils.copy(in, fileOutputStream);
FileCopyUtils.copy(in, fileOutputStream);
}
finally {
IOUtils.closeQuietly(in);
IOUtils.closeQuietly(fileOutputStream);
in.close();
fileOutputStream.close();
}
if (tmpLocalTarget.renameTo(localFile)) {
this.acknowledge(session, entry);

View File

@@ -24,9 +24,6 @@ import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.nio.charset.Charset;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.SystemUtils;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.Resource;
import org.springframework.expression.Expression;
@@ -65,7 +62,8 @@ public class SftpSendingMessageHandler extends AbstractMessageHandler {
private volatile File temporaryBufferFolderFile;
private volatile Resource temporaryBufferFolder = new FileSystemResource(SystemUtils.getJavaIoTmpDir());
private volatile Resource temporaryBufferFolder =
new FileSystemResource(System.getProperty("java.io.tmpdir"));
private volatile String charset = Charset.defaultCharset().name();
@@ -184,7 +182,7 @@ public class SftpSendingMessageHandler extends AbstractMessageHandler {
return true;
}
finally {
IOUtils.closeQuietly(fileInputStream);
fileInputStream.close();
session.close();
}
}

View File

@@ -5,8 +5,6 @@ Bundle-Version: ${version}
Bundle-ManifestVersion: 2
Import-Template:
org.apache.commons.logging;version="[1.1.1, 2.0.0)",
org.apache.commons.lang.*;version="[2.5.0, 3.0.0)",
org.apache.commons.io.*;version="[1.4.0, 2.0.0)",
org.springframework.integration.*;version="[2.0.0, 2.0.1)",
org.springframework.beans.*;version="[3.0.5, 4.0.0)",
org.springframework.context;version="[3.0.5, 4.0.0)",

View File

@@ -6,7 +6,6 @@ Bundle-ManifestVersion: 2
Import-Template:
org.aopalliance.*;version="[1.0.0, 2.0.0)",
org.apache.commons.logging;version="[1.1.1, 2.0.0)",
org.apache.commons.lang.*;version="[2.5.0, 3.0.0)",
org.springframework.integration.*;version="[2.0.0, 2.0.1)",
org.springframework.scheduling.*;version="[3.0.5, 4.0.0)",
org.springframework.aop.*;version="[3.0.5, 4.0.0)",
@@ -16,7 +15,6 @@ Import-Template:
org.springframework.scheduling.*;version="[3.0.5, 4.0.0)",
org.springframework.util;version="[3.0.5, 4.0.0)",
org.jivesoftware.*;version="[3.1.0, 4.0.0)",
org.apache.commons.io.*;version="[1.4, 3.0)",
twitter4j.*;version="[2.1.0, 2.3.0)",
javax.*;version="0",
org.w3c.dom.*;version="0"

View File

@@ -5,7 +5,6 @@ Bundle-Version: ${version}
Bundle-ManifestVersion: 2
Import-Template:
org.apache.commons.logging;version="[1.1.1, 2.0.0)",
org.apache.commons.lang.*;version="[2.5.0, 3.0.0)",
org.springframework.integration.*;version="[2.0.0, 2.0.1)",
org.springframework.beans.*;version="[3.0.5, 4.0.0)",
org.springframework.context;version="[3.0.5, 4.0.0)",