Class NativeUtils


  • public class NativeUtils
    extends java.lang.Object
    Utils for loading native checksum library.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String OS_NAME  
    • Constructor Summary

      Constructors 
      Constructor Description
      NativeUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String libType()
      Returns jni library extension based on OS specification.
      static void loadLibraryFromJar​(java.lang.String path)
      loads given library from the this jar.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • OS_NAME

        public static final java.lang.String OS_NAME
    • Constructor Detail

      • NativeUtils

        public NativeUtils()
    • Method Detail

      • loadLibraryFromJar

        public static void loadLibraryFromJar​(java.lang.String path)
                                       throws java.lang.Exception
        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:
        java.lang.Exception
      • libType

        public static java.lang.String 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: