Merge pull request #105 from alexeydergunov/fix-file-not-found
Fix FileNotFoundException while writing the library file
This commit is contained in:
commit
0efe115bad
|
@ -300,11 +300,13 @@ public class SnappyLoader
|
||||||
}
|
}
|
||||||
|
|
||||||
// Temporary folder for the native lib. Use the value of org.xerial.snappy.tempdir or java.io.tmpdir
|
// Temporary folder for the native lib. Use the value of org.xerial.snappy.tempdir or java.io.tmpdir
|
||||||
String tempFolder = new File(System.getProperty(KEY_SNAPPY_TEMPDIR,
|
File tempFolder = new File(System.getProperty(KEY_SNAPPY_TEMPDIR, System.getProperty("java.io.tmpdir")));
|
||||||
System.getProperty("java.io.tmpdir"))).getAbsolutePath();
|
if (!tempFolder.exists()) {
|
||||||
|
tempFolder.mkdir();
|
||||||
|
}
|
||||||
|
|
||||||
// Extract and load a native library inside the jar file
|
// Extract and load a native library inside the jar file
|
||||||
return extractLibraryFile(snappyNativeLibraryPath, snappyNativeLibraryName, tempFolder);
|
return extractLibraryFile(snappyNativeLibraryPath, snappyNativeLibraryName, tempFolder.getAbsolutePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue