Obtain the sshj.properties resource from the ClassLoader that loaded the DefaultConfig class, not from the context classloader.

This commit is contained in:
David Solin
2016-12-21 10:04:56 -06:00
parent 766ab916ee
commit 9e3b9f7c24

View File

@@ -85,7 +85,7 @@ public class DefaultConfig
private String readVersionFromProperties() {
try {
Properties properties = new Properties();
properties.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("sshj.properties"));
properties.load(DefaultConfig.class.getClassLoader().getResourceAsStream("sshj.properties"));
String property = properties.getProperty("sshj.version");
return "SSHJ_" + property.replace('-', '_'); // '-' is a disallowed character, see RFC-4253#section-4.2
} catch (IOException e) {