]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rocksdb/java/src/main/java/org/rocksdb/NativeLibraryLoader.java
import quincy beta 17.1.0
[ceph.git] / ceph / src / rocksdb / java / src / main / java / org / rocksdb / NativeLibraryLoader.java
index 6e37e8cf205c8d338220faa8bdb029332e083828..e47eacb22116b1eec59f6f797aa41c7d631a5c74 100644 (file)
@@ -87,7 +87,12 @@ public class NativeLibraryLoader {
     if (tmpDir == null || tmpDir.isEmpty()) {
       temp = File.createTempFile(tempFilePrefix, tempFileSuffix);
     } else {
-      temp = new File(tmpDir, jniLibraryFileName);
+      final File parentDir = new File(tmpDir);
+      if (!parentDir.exists()) {
+        throw new RuntimeException(
+            "Directory: " + parentDir.getAbsolutePath() + " does not exist!");
+      }
+      temp = new File(parentDir, jniLibraryFileName);
       if (temp.exists() && !temp.delete()) {
         throw new RuntimeException("File: " + temp.getAbsolutePath()
             + " already exists and cannot be removed.");