Package org.drasyl.crypto.loader
Class NativeLoader
java.lang.Object
org.drasyl.crypto.loader.NativeLoader
This class helps to load native libraries, used with JNA.
Based on: native-utils
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
loadLibraryFromFileSystem
(String path, Class clazz) Loads library from current file systemstatic void
loadLibraryFromJar
(String path, Class clazz) Loads library from current JAR archive
-
Field Details
-
NATIVE_FOLDER_PATH_PREFIX
- See Also:
-
-
Method Details
-
loadLibraryFromJar
Loads library from current JAR archiveThe file 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.
- Parameters:
path
- The path of file as absolute path (beginning with '/'), e.g. /package/File.ext- Throws:
IOException
- If library could not be loaded
-
loadLibraryFromFileSystem
Loads library from current file systemThe file 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.
- Parameters:
path
- The path of file as absolute path (beginning with '/'), e.g. /package/File.ext- Throws:
IOException
- If library could not be loaded
-