Remove commons-io dependency in netconf-ssh 56/21856/3
authorTomas Cere <tcere@cisco.com>
Wed, 3 Jun 2015 14:22:00 +0000 (16:22 +0200)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 18 Jun 2015 13:19:31 +0000 (13:19 +0000)
Remove the replacement of File separators in key path,
windows can handle linux style paths, added a warning to config to use linux style paths.

Change-Id: I01d07fa65cd11dcc321cbf4d6f5aac0792922309
Signed-off-by: Tomas Cere <tcere@cisco.com>
karaf/opendaylight-karaf-resources/src/main/resources/etc/custom.properties
opendaylight/netconf/netconf-ssh/pom.xml
opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/osgi/NetconfSSHActivator.java

index ab16bf8..a21e20e 100644 (file)
@@ -22,6 +22,7 @@ netconf.tcp.client.port=8383
 
 netconf.ssh.address=0.0.0.0
 netconf.ssh.port=1830
+# Use Linux style path
 netconf.ssh.pk.path = ./configuration/RSA.pk
 # Set security provider to BouncyCastle
 org.apache.karaf.security.providers = org.bouncycastle.jce.provider.BouncyCastleProvider
index 6ee17e6..6bf305e 100644 (file)
     <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>netconf-impl</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>commons-io</groupId>
-      <artifactId>commons-io</artifactId>
     </dependency>
       <dependency>
           <groupId>org.opendaylight.controller</groupId>
index 23c92e8..fa87b73 100644 (file)
@@ -19,7 +19,6 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.ThreadFactory;
-import org.apache.commons.io.FilenameUtils;
 import org.apache.sshd.common.util.ThreadUtils;
 import org.apache.sshd.server.keyprovider.PEMGeneratorHostKeyProvider;
 import org.opendaylight.controller.netconf.ssh.SshProxyServer;
@@ -85,7 +84,7 @@ public class NetconfSSHActivator implements BundleActivator {
     private SshProxyServer startSSHServer(final BundleContext bundleContext) throws IOException {
         final Optional<InetSocketAddress> maybeSshSocketAddress = NetconfConfigUtil.extractNetconfServerAddress(bundleContext, InfixProp.ssh);
 
-        if (maybeSshSocketAddress.isPresent() == false) {
+        if (!maybeSshSocketAddress.isPresent()) {
             LOG.trace("SSH bridge not configured");
             return null;
         }
@@ -97,7 +96,8 @@ public class NetconfSSHActivator implements BundleActivator {
 
         authProviderTracker = new AuthProviderTracker(bundleContext);
 
-        final String path = FilenameUtils.separatorsToSystem(NetconfConfigUtil.getPrivateKeyPath(bundleContext));
+        final String path = NetconfConfigUtil.getPrivateKeyPath(bundleContext);
+
         checkState(!Strings.isNullOrEmpty(path), "Path to ssh private key is blank. Reconfigure %s",
                 NetconfConfigUtil.getPrivateKeyKey());
 

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.