static boolean extract(String libPath, boolean withLinuxVendor, StringBuffer message) { String libFullName = computeLibraryFullName(withLinuxVendor); return extract(libPath + SEPARATOR + libFullName, libFullName, message); }
static void loadLibrary(final String tempDirectory) { if (PlatformDetector.OS.isAndroid()) { System.loadLibrary("j2v8"); return; } StringBuffer message = new StringBuffer(); // try loading a vendor-specific library first if (tryLoad(true, message)) return; // if there is no vendor-specific library, just try to load the default OS library if (tryLoad(false, message)) return; String path = null; if (tempDirectory != null) { path = tempDirectory; } else { path = System.getProperty("java.io.tmpdir"); //$NON-NLS-1$ } // try extracting a vendor-specific library first if (extract(path, true, message)) return; // if there is no vendor-specific library, just try to extract the default OS library if (extract(path, false, message)) return; /* Failed to find the library */ throw new UnsatisfiedLinkError("Could not load J2V8 library. Reasons: " + message.toString()); //$NON-NLS-1$ }
static boolean extract(String libPath, boolean withLinuxVendor, StringBuffer message) { String libFullName = computeLibraryFullName(withLinuxVendor); return extract(libPath + SEPARATOR + libFullName, libFullName, message); }
static void loadLibrary(final String tempDirectory) { if (PlatformDetector.OS.isAndroid()) { System.loadLibrary("j2v8"); return; } StringBuffer message = new StringBuffer(); // try loading a vendor-specific library first if (tryLoad(true, message)) return; // if there is no vendor-specific library, just try to load the default OS library if (tryLoad(false, message)) return; String path = null; if (tempDirectory != null) { path = tempDirectory; } else { path = System.getProperty("java.io.tmpdir"); //$NON-NLS-1$ } // try extracting a vendor-specific library first if (extract(path, true, message)) return; // if there is no vendor-specific library, just try to extract the default OS library if (extract(path, false, message)) return; /* Failed to find the library */ throw new UnsatisfiedLinkError("Could not load J2V8 library. Reasons: " + message.toString()); //$NON-NLS-1$ }
if (extract(path + SEPARATOR + libFullName, libFullName, message)) { return;
if (extract(path + SEPARATOR + libFullName, libFullName, message)) { return;