Class NativeUtils
java.lang.Object
org.apache.bookkeeper.common.util.nativelib.NativeUtils
Utility class to load jni library from inside a JAR.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckArgument(boolean expression, @NonNull Object errorMessage) static StringlibType()Returns jni library extension based on OS specification.static voidloadLibraryFromJar(String path) loads given library from the this jar.
-
Field Details
-
OS_NAME
-
TEMP_WORKDIR_PROPERTY_NAME
- See Also:
-
-
Method Details
-
loadLibraryFromJar
loads given library from the this jar. ie: this jar contains: /lib/pulsar-checksum.jnilib- Parameters:
path- : absolute path of the library in the jar
if this jar contains: /lib/pulsar-checksum.jnilib then provide the same absolute path as input- Throws:
Exception
-
libType
Returns jni library extension based on OS specification. Maven-nar generates jni library based on different OS : http://mark.donszelmann.org/maven-nar-plugin/aol.html (jni.extension)- Returns:
- library type
-
checkArgument
-