Commit cf8c0cd8 authored by Maxim's avatar Maxim
Browse files

remove StringUtil lib.

parent 6cca69ca
......@@ -16,6 +16,8 @@
package org.genesys.filerepository.service.ftp;
import java.io.File;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.HashMap;
import java.util.Map;
......@@ -31,7 +33,6 @@ import org.apache.ftpserver.ftplet.UserManager;
import org.apache.ftpserver.listener.ListenerFactory;
import org.apache.ftpserver.message.MessageResource;
import org.apache.ftpserver.ssl.SslConfigurationFactory;
import org.hsqldb.lib.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.DisposableBean;
......@@ -118,7 +119,7 @@ public class RepositoryFtpServer implements InitializingBean, DisposableBean {
this.maxThreads = maxThreads;
}
public void afterPropertiesSet() throws FtpException {
public void afterPropertiesSet() throws FtpException, UnknownHostException {
FtpServerFactory serverFactory = new FtpServerFactory();
serverFactory.setUserManager(userManager);
......@@ -146,9 +147,10 @@ public class RepositoryFtpServer implements InitializingBean, DisposableBean {
// define Data Connection configuration
DataConnectionConfigurationFactory dccf = new DataConnectionConfigurationFactory();
dccf.setPassivePorts(passivePorts);
if (!StringUtil.isEmpty(externalAddress)) {
dccf.setPassiveExternalAddress(externalAddress);
}
if (externalAddress != null) {
InetAddress address = InetAddress.getByName(externalAddress);
dccf.setPassiveExternalAddress(address.getHostAddress());
}
factory.setDataConnectionConfiguration(dccf.createDataConnectionConfiguration());
// replace the default listener
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment