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 ab16bf8621823fa599524b9b6090e5906d21622f..a21e20ee035fc1c4902c85709d423d59b6184f8c 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 6ee17e6cad77d8a64a73009aeebeda35ced54a26..6bf305e7e441aad1a4bd7fe9a6d7e0e1ada0c0b7 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 23c92e86488b06d31ae9d15bd4af91eaea06c987..fa87b73fad2b10bc977f0d88134c1fe21f5fb676 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());