/** * Searches through a list of directories for a native library. * * @param libName the base name (e.g. "c") of the library to locate * @param libraryPath the list of directories to search * @return the path of the library */ public String locateLibrary(String libName, List<String> libraryPath) { String mappedName = mapLibraryName(libName); for (String path : libraryPath) { File libFile = new File(path, mappedName); if (libFile.exists()) { return libFile.getAbsolutePath(); } } // Default to letting the system search for it return mappedName; } private static class Supported extends Platform {
/** * Searches through a list of directories for a native library. * * @param libName the base name (e.g. "c") of the library to locate * @param libraryPath the list of directories to search * @return the path of the library */ public String locateLibrary(String libName, List<String> libraryPath) { String mappedName = mapLibraryName(libName); for (String path : libraryPath) { File libFile = new File(path, mappedName); if (libFile.exists()) { return libFile.getAbsolutePath(); } } // Default to letting the system search for it return mappedName; } private static class Supported extends Platform {
/** * Searches through a list of directories for a native library. * * @param libName the base name (e.g. "c") of the library to locate * @param libraryPath the list of directories to search * @return the path of the library */ public String locateLibrary(String libName, List<String> libraryPath) { String mappedName = mapLibraryName(libName); for (String path : libraryPath) { File libFile = new File(path, mappedName); if (libFile.exists()) { return libFile.getAbsolutePath(); } } // Default to letting the system search for it return mappedName; } private static class Supported extends Platform {