Skip to content

Commit

Permalink
Ensure absolute path is used for library
Browse files Browse the repository at this point in the history
[`System#load`][1] requires an absolute path.  If the extraction
directory (`library.${name}.path` or `java.io.tmpdir`) is relative, the
extraction will succeed, but the `System#load` call will fail, resulting
in the library not being loaded.  This commit rectifies that by
obtaining the absolute path to the directory before extracting.

[1]: http://docs.oracle.com/javase/7/docs/api/java/lang/System.html#load(java.lang.String)
  • Loading branch information
NJAldwin committed Oct 7, 2014
1 parent 8c28532 commit 3d3aa0b
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ private String map(String libName) {

private File extract(ArrayList<String> errors, URL source, String prefix, String suffix, File directory) {
File target = null;
if (directory != null) {
directory = directory.getAbsoluteFile();
}
try {
FileOutputStream os = null;
InputStream is = null;
Expand Down

0 comments on commit 3d3aa0b

Please sign in to comment.