diff --git a/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/Library.java b/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/Library.java index 7960bbbb..da25e825 100755 --- a/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/Library.java +++ b/hawtjni-runtime/src/main/java/org/fusesource/hawtjni/runtime/Library.java @@ -86,6 +86,8 @@ public class Library { final private String version; final private ClassLoader classLoader; private boolean loaded; + private String nativeLibraryPath; + private URL nativeLibrarySourceUrl; public Library(String name) { this(name, null, null); @@ -116,6 +118,24 @@ private static String version(Class> clazz) { return null; } + /** + * Get the path to the native library loaded. + * @return the path (should not be null once the library is loaded) + * @since 1.16 + */ + public String getNativeLibraryPath() { + return nativeLibraryPath; + } + + /** + * Get the URL to the native library source that has been extracted (if it was extracted). + * @return the url to the source (in classpath) + * @since 1.16 + */ + public URL getNativeLibrarySourceUrl() { + return nativeLibrarySourceUrl; + } + public static String getOperatingSystem() { String name = System.getProperty("os.name").toLowerCase().trim(); if( name.startsWith("linux") ) { @@ -147,7 +167,7 @@ public static int getBitModel() { } /** - * + * Load the native library. */ synchronized public void load() { if( loaded ) { @@ -181,11 +201,11 @@ private void doLoad() { } /* Try loading library from java library path */ - if( version!=null && load(errors, name + getBitModel() + "-" + version) ) + if( version!=null && loadLibrary(errors, name + getBitModel() + "-" + version) ) return; - if( version!=null && load(errors, name + "-" + version) ) + if( version!=null && loadLibrary(errors, name + "-" + version) ) return; - if( load(errors, name ) ) + if( loadLibrary(errors, name) ) return; @@ -262,6 +282,7 @@ final public String getLibraryFileName() { *