String pathSeparator = System.getProperty("path.separator");
String fileSeparator = System.getProperty("file.separator");
allPaths = (jlp!=null?jlp:"")+(vblp!=null?pathSeparator+vblp:"")+(udp!=null?pathSeparator+udp:"");
if (allPaths.length()==0) {
throw new UnsatisfiedLinkError("Can not find the library: " +
libname);
}
//String[] paths = allPaths.split(pathSeparator);
String[] paths;
{
ArrayList<String> res = new ArrayList<String>();
int curPos = 0;
int l = pathSeparator.length();
int i = allPaths.indexOf(pathSeparator);
int in = 0;
while (i != -1) {
String s = allPaths.substring(curPos, i);
res.add(s);
in++;
curPos = i + l;
i = allPaths.indexOf(pathSeparator, curPos);
}
if (curPos <= allPaths.length()) {
String s = allPaths.substring(curPos, allPaths.length());
in++;
res.add(s);
}
paths = (String[]) res.toArray(new String[in]);
}
libname = System.mapLibraryName(libname);
for (int i=0; i<paths.length; i++) {
if (paths[i]==null) {
continue;
}
libFullName = paths[i] + fileSeparator + libname;
try {
this.load0(libFullName, cL, false);
return;
} catch (UnsatisfiedLinkError e) {
}
}
} else {
this.load0(libFullName, cL, false);
return;
}
throw new UnsatisfiedLinkError("Can not find the library: " +
libname);
}