Package net.sourceforge.lept4j.util
Class LoadLibs
- java.lang.Object
-
- net.sourceforge.lept4j.util.LoadLibs
-
public class LoadLibs extends java.lang.ObjectLoads native libraries from JAR or project folder.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringJNA_LIBRARY_PATHstatic java.lang.StringLEPT4J_TEMP_DIRstatic java.lang.StringLIB_NAMENative library name.static java.lang.StringLIB_NAME_NON_WINprivate static java.util.logging.Loggerlogger
-
Constructor Summary
Constructors Constructor Description LoadLibs()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static voidcopyJarResourceToDirectory(java.net.JarURLConnection jarConnection, java.io.File destDir)Copies resources from the jar file of the current thread and extract it to the destination directory.static java.io.FileextractNativeResources(java.lang.String dirname)Extracts Leptonica resources to temp folder.static LeptonicagetLeptonicaInstance()Loads Leptonica library via JNA.static java.lang.StringgetLeptonicaLibName()Gets native library name.
-
-
-
Field Detail
-
JNA_LIBRARY_PATH
private static final java.lang.String JNA_LIBRARY_PATH
- See Also:
- Constant Field Values
-
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
-
logger
private static final java.util.logging.Logger logger
-
-
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
-
copyJarResourceToDirectory
static void copyJarResourceToDirectory(java.net.JarURLConnection jarConnection, java.io.File destDir)Copies resources from the jar file of the current thread and extract it to the destination directory.- Parameters:
jarConnection-destDir-
-
-