Fix FileNotFoundException while writing the library file

This commit is contained in:
Aleksey Dergunov 2015-05-12 20:01:48 +04:00
parent 75cb0e5213
commit 708752efa5
1 changed files with 5 additions and 3 deletions

View File

@ -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
String tempFolder = new File(System.getProperty(KEY_SNAPPY_TEMPDIR,
System.getProperty("java.io.tmpdir"))).getAbsolutePath();
File tempFolder = new File(System.getProperty(KEY_SNAPPY_TEMPDIR, System.getProperty("java.io.tmpdir")));
if (!tempFolder.exists()) {
tempFolder.mkdir();
}
// Extract and load a native library inside the jar file
return extractLibraryFile(snappyNativeLibraryPath, snappyNativeLibraryName, tempFolder);
return extractLibraryFile(snappyNativeLibraryPath, snappyNativeLibraryName, tempFolder.getAbsolutePath());
}