Class LoadLibs


  • public class LoadLibs
    extends java.lang.Object
    Loads native libraries from JAR or project folder.
    Author:
    O.J. Sousa Rodrigues, Quan Nguyen
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String LEPT4J_TEMP_DIR  
      static java.lang.String LIB_NAME
      Native library name.
      static java.lang.String LIB_NAME_NON_WIN  
    • Constructor Summary

      Constructors 
      Constructor Description
      LoadLibs()  
    • Method Summary

      Modifier and Type Method Description
      static java.io.File extractNativeResources​(java.lang.String dirname)
      Extracts Leptonica resources to temp folder.
      static Leptonica getLeptonicaInstance()
      Loads Leptonica library via JNA.
      static java.lang.String getLeptonicaLibName()
      Gets native library name.
      • Methods inherited from class java.lang.Object

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

      • LEPT4J_TEMP_DIR

        public static final java.lang.String LEPT4J_TEMP_DIR
      • LIB_NAME

        public static final java.lang.String LIB_NAME
        Native library name.
        See Also:
        Constant Field Values
      • LIB_NAME_NON_WIN

        public static final java.lang.String LIB_NAME_NON_WIN
        See Also:
        Constant Field Values
    • Constructor Detail

      • LoadLibs

        public LoadLibs()
    • Method Detail

      • getLeptonicaInstance

        public static Leptonica getLeptonicaInstance()
        Loads Leptonica library via JNA.
        Returns:
        Leptonica instance being loaded using Native.loadLibrary().
      • getLeptonicaLibName

        public static java.lang.String getLeptonicaLibName()
        Gets native library name.
        Returns:
        the name of the Leptonica library to be loaded using the Native.register().
      • extractNativeResources

        public static java.io.File extractNativeResources​(java.lang.String dirname)
        Extracts Leptonica resources to temp folder.
        Parameters:
        dirname - resource location
        Returns:
        target location