[SIGAR-82] Add /usr/local/lib/vmware to search path
This commit is contained in:
parent
8a123d4d06
commit
4c522ad7ed
|
@ -76,16 +76,28 @@ public class VMControlLibrary {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static File getVMwareLib() {
|
private static File getVMwareLib() {
|
||||||
String location = "/usr/lib/vmware";
|
String[] locations = {
|
||||||
File lib = new File(location);
|
"/usr/lib/vmware",
|
||||||
if (lib.exists()) {
|
"/usr/local/lib/vmware",
|
||||||
//running on a VMware host
|
};
|
||||||
return lib;
|
|
||||||
|
for (int i=0; i<locations.length; i++) {
|
||||||
|
File lib = new File(locations[i]);
|
||||||
|
if (lib.exists()) {
|
||||||
|
//running on a VMware host
|
||||||
|
return lib;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
//remote w/ api installed
|
for (int i=0; i<locations.length; i++) {
|
||||||
return new File(location + "-api");
|
File lib = new File(locations[i] + "-api");
|
||||||
|
if (lib.exists()) {
|
||||||
|
//remote w/ api installed
|
||||||
|
return lib;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return new File(locations[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static File getLib(String name) {
|
private static File getLib(String name) {
|
||||||
|
|
Loading…
Reference in New Issue