public final class LibraryLoader
extends java.lang.Object
This class is thread-safe.
| Modifier and Type | Class and Description |
|---|---|
static class |
LibraryLoader.Mode
Library loading mode controls which libraries are attempted to be loaded (installed in the system or bundled
in the Lazysodium JAR) and in which order.
|
| Constructor and Description |
|---|
LibraryLoader(java.util.List<java.lang.Class> classesToRegister) |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getSodiumPathInResources()
Returns the absolute path to sodium library inside JAR (beginning with '/'), e.g.
|
void |
loadAbsolutePath(java.lang.String absPath) |
void |
loadLibrary(LibraryLoader.Mode mode,
java.lang.String systemFallBack)
Loads the sodium library and registers the native methods of
Sodium
and SodiumJava using the specified loading mode. |
void |
loadSystemLibrary(java.lang.String library) |
public LibraryLoader(java.util.List<java.lang.Class> classesToRegister)
public void loadLibrary(LibraryLoader.Mode mode, java.lang.String systemFallBack)
Sodium
and SodiumJava using the specified loading mode.
The library will be loaded at most once.mode - controls which sodium library (installed in the system or bundled in the JAR)
is loaded, and in which ordersystemFallBack - If loading directly fails then it will fall to the system fallback specified hereLibraryLoadingException - if fails to load the libraryNative.register(Class, String)public void loadSystemLibrary(java.lang.String library)
public void loadAbsolutePath(java.lang.String absPath)
public static java.lang.String getSodiumPathInResources()