improve library load debugging

Esse commit está contido em:
Timothy Wall
2013-06-02 08:44:32 -04:00
commit 2239bdfdfd
2 arquivos alterados com 4 adições e 4 exclusões
+3 -4
Ver Arquivo
@@ -818,6 +818,9 @@ public final class Native implements Version {
}
throw new IOException("Native library (" + resourcePath + ") not found in resource path (" + path + ")");
}
if (DEBUG_LOAD) {
System.out.println("Found library resource at " + url);
}
File lib = null;
if (url.getProtocol().toLowerCase().equals("file")) {
@@ -835,10 +838,6 @@ public final class Native implements Version {
}
}
else if (!Boolean.getBoolean("jna.nounpack")) {
if (Native.DEBUG_LOAD) {
System.out.println("Looking in " + resourcePath);
}
InputStream is = loader.getResourceAsStream(resourcePath);
if (is == null) {
throw new IOException("Can't obtain InputStream for " + resourcePath);
+1
Ver Arquivo
@@ -256,6 +256,7 @@ public class NativeLibrary {
try {
File embedded = Native.extractFromResourcePath(libraryName, (ClassLoader)options.get(Library.OPTION_CLASSLOADER));
handle = Native.open(embedded.getAbsolutePath());
libraryPath = embedded.getAbsolutePath();
// Don't leave temporary files around
if (Native.isUnpacked(embedded)) {
Native.deleteLibrary(embedded);