Class LoadLibs


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

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

      Constructors 
      Constructor Description
      LoadLibs()  
    • Method Summary

      Modifier and Type Method Description
      static java.io.File extractTessResources​(java.lang.String resourceName)
      Extracts tesseract resources to temp folder.
      static TessAPI getTessAPIInstance()
      Loads Tesseract library via JNA.
      static java.lang.String getTesseractLibName()
      Gets native library name.
      • Methods inherited from class java.lang.Object

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

      • TESS4J_TEMP_DIR

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

      • getTessAPIInstance

        public static TessAPI getTessAPIInstance()
        Loads Tesseract library via JNA.
        Returns:
        TessAPI instance being loaded using Native.loadLibrary().
      • getTesseractLibName

        public static java.lang.String getTesseractLibName()
        Gets native library name.
        Returns:
        the name of the tesseract library to be loaded using the Native.register().
      • extractTessResources

        public static java.io.File extractTessResources​(java.lang.String resourceName)
        Extracts tesseract resources to temp folder.
        Parameters:
        resourceName - name of file or directory
        Returns:
        target path, which could be file or directory