NIFI-1302 find dynamic libraries with standard names

Signed-off-by: joewitt <joewitt@apache.org>
This commit is contained in:
Mike Moser 2015-12-17 18:12:36 -05:00 committed by joewitt
parent 04e9606770
commit f239be289e
1 changed files with 7 additions and 6 deletions

View File

@ -206,14 +206,15 @@ public class NarClassLoader extends URLClassLoader {
} }
final File nativeDir = new File(dependencies, "native"); final File nativeDir = new File(dependencies, "native");
final File soFile = new File(nativeDir, libname + ".so"); final File libsoFile = new File(nativeDir, "lib" + libname + ".so");
if (soFile.exists()) {
return soFile.getAbsolutePath();
} else {
final File dllFile = new File(nativeDir, libname + ".dll"); final File dllFile = new File(nativeDir, libname + ".dll");
if (dllFile.exists()) { final File soFile = new File(nativeDir, libname + ".so");
if (libsoFile.exists()) {
return libsoFile.getAbsolutePath();
} else if (dllFile.exists()) {
return dllFile.getAbsolutePath(); return dllFile.getAbsolutePath();
} } else if (soFile.exists()) {
return soFile.getAbsolutePath();
} }
// not found in the nar. try system native dir // not found in the nar. try system native dir