Package ml.dmlc.xgboost4j.java
Class NativeLibLoader
java.lang.Object
ml.dmlc.xgboost4j.java.NativeLibLoader
class to load native library
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static String
Create a temp file that copies the resource from current JAR archive(package private) static void
private static void
loadLibraryFromJar
(String path) Loads library from current JAR archive
-
Field Details
-
logger
private static final org.apache.commons.logging.Log logger -
initialized
private static boolean initialized -
nativeResourcePath
- See Also:
-
libNames
-
-
Constructor Details
-
NativeLibLoader
NativeLibLoader()
-
-
Method Details
-
initXGBoost
- Throws:
IOException
-
loadLibraryFromJar
Loads library from current JAR archive The file from JAR is copied into system temporary directory and then loaded. The temporary file is deleted after exiting. Method uses String as filename because the pathname is "abstract", not system-dependent. The restrictions ofFile.createTempFile(java.lang.String, java.lang.String)
apply topath
.- Parameters:
path
- The filename inside JAR as absolute path (beginning with '/'), e.g. /package/File.ext- Throws:
IOException
- If temporary file creation or read/write operation failsIllegalArgumentException
- If source file (param path) does not existIllegalArgumentException
- If the path is not absolute or if the filename is shorter than three characters
-
createTempFileFromResource
Create a temp file that copies the resource from current JAR archive The file from JAR is copied into system temp file. The temporary file is deleted after exiting. Method uses String as filename because the pathname is "abstract", not system-dependent. The restrictions ofFile.createTempFile(java.lang.String, java.lang.String)
apply topath
.- Parameters:
path
- Path to the resources in the jar- Returns:
- The created temp file.
- Throws:
IOException
IllegalArgumentException
-