Package net.sourceforge.lept4j.util
Class LoadLibs
java.lang.Object
net.sourceforge.lept4j.util.LoadLibs
Loads native libraries from JAR or project folder.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static voidcopyJarResourceToDirectory(JarURLConnection jarConnection, File destDir) Copies resources from the jar file of the current thread and extract it to the destination directory.static FileextractNativeResources(String dirname) Extracts Leptonica resources to temp folder.static LeptonicaLoads Leptonica library via JNA.static StringGets native library name.
-
Field Details
-
JNA_LIBRARY_PATH
- See Also:
-
LEPT4J_TEMP_DIR
-
LIB_NAME
Native library name.- See Also:
-
LIB_NAME_NON_WIN
- See Also:
-
logger
-
-
Constructor Details
-
LoadLibs
public LoadLibs()
-
-
Method Details
-
getLeptonicaInstance
Loads Leptonica library via JNA.- Returns:
- Leptonica instance being loaded using
Native.loadLibrary().
-
getLeptonicaLibName
Gets native library name.- Returns:
- the name of the Leptonica library to be loaded using the
Native.register().
-
extractNativeResources
Extracts Leptonica resources to temp folder.- Parameters:
dirname- resource location- Returns:
- target location
-
copyJarResourceToDirectory
Copies resources from the jar file of the current thread and extract it to the destination directory.- Parameters:
jarConnection-destDir-
-