From 7687dc67eecf24f7ca4885f8356e01a31200b037 Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Sun, 21 Nov 2010 12:57:36 -0500 Subject: [PATCH] INT-1614 removing dependencies on commons-lang --- build.gradle | 4 ---- .../integration/sftp/session/SftpSession.java | 10 +++++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index fc4ff58556..ecb2ac6eb1 100644 --- a/build.gradle +++ b/build.gradle @@ -207,8 +207,6 @@ project('spring-integration-ftp') { description = 'Spring Integration FTP Support' dependencies { compile project(":spring-integration-file") - compile "commons-io:commons-io:$commonsIoVersion" - compile "commons-lang:commons-lang:$commonsLangVersion" compile "commons-net:commons-net:$commonsNetVersion" compile "org.springframework:spring-context-support:$springVersion" compile("javax.activation:activation:$javaxActivationVersion") { optional = true } @@ -339,8 +337,6 @@ project('spring-integration-sftp') { compile project(":spring-integration-file") compile project(":spring-integration-stream") compile "com.jcraft:jsch:0.1.42" - compile "commons-io:commons-io:$commonsIoVersion" - compile "commons-lang:commons-lang:$commonsLangVersion" compile "org.springframework:spring-context-support:$springVersion" compile("javax.activation:activation:$javaxActivationVersion") { optional = true } testCompile project(":spring-integration-test") diff --git a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/SftpSession.java b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/SftpSession.java index f0d122f356..c94b38bd4a 100644 --- a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/SftpSession.java +++ b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/SftpSession.java @@ -20,12 +20,12 @@ import java.io.InputStream; import java.util.Collection; import java.util.Collections; -import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.integration.file.remote.session.Session; import org.springframework.util.Assert; +import org.springframework.util.StringUtils; import com.jcraft.jsch.ChannelSftp; import com.jcraft.jsch.JSch; @@ -88,15 +88,15 @@ public class SftpSession implements Session { } this.privateKey = privateKey; this.privateKeyPassphrase = pvKeyPassPhrase; - if (!StringUtils.isEmpty(knownHostsFile)) { + if (StringUtils.hasText(knownHostsFile)) { jSch.setKnownHosts(knownHostsFile); } - else if (null != knownHostsInputStream) { + else if (knownHostsInputStream != null) { jSch.setKnownHosts(knownHostsInputStream); } // private key if (privateKey != null) { - if (!StringUtils.isEmpty(privateKeyPassphrase)) { + if (StringUtils.hasText(privateKeyPassphrase)) { jSch.addIdentity(this.privateKey, privateKeyPassphrase); } else { @@ -104,7 +104,7 @@ public class SftpSession implements Session { } } this.jschSession = jSch.getSession(userName, hostName, port); - if (!StringUtils.isEmpty(userPassword)) { + if (StringUtils.hasText(userPassword)) { this.jschSession.setPassword(userPassword); } this.userInfo = new OptimisticUserInfoImpl(userPassword);