mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Squashed 'src/rocksdb2/' content from commit 37c6740
git-subtree-dir: src/rocksdb2 git-subtree-split: 37c6740c383bb9a6ee2747b04f08bc77fcfa10c5
This commit is contained in:
37
java/org/rocksdb/util/Environment.java
Normal file
37
java/org/rocksdb/util/Environment.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package org.rocksdb.util;
|
||||
|
||||
public class Environment {
|
||||
private static String OS = System.getProperty("os.name").toLowerCase();
|
||||
|
||||
public static boolean isWindows() {
|
||||
return (OS.indexOf("win") >= 0);
|
||||
}
|
||||
|
||||
public static boolean isMac() {
|
||||
return (OS.indexOf("mac") >= 0);
|
||||
}
|
||||
|
||||
public static boolean isUnix() {
|
||||
return (OS.indexOf("nix") >= 0 ||
|
||||
OS.indexOf("nux") >= 0 ||
|
||||
OS.indexOf("aix") >= 0);
|
||||
}
|
||||
|
||||
public static String getSharedLibraryName(String name) {
|
||||
if (isUnix()) {
|
||||
return String.format("lib%s.so", name);
|
||||
} else if (isMac()) {
|
||||
return String.format("lib%s.dylib", name);
|
||||
}
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public static String getJniLibraryName(String name) {
|
||||
if (isUnix()) {
|
||||
return String.format("lib%s.so", name);
|
||||
} else if (isMac()) {
|
||||
return String.format("lib%s.jnilib", name);
|
||||
}
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user