public final class FFNativeLibraryLoader extends Object
System.loadLibrary(String)
,
upon failure falls back to the base directory of the given class package or the jar the class
is in. This way, a native library is found, if it is located in the same directory as a particular jar, identified
by a specific class from that jar.Modifier and Type | Method and Description |
---|---|
static String |
findFile(String name,
Class<?> baseClass,
FileFilter filter)
Finds a file that is either in the classpath or in the same directory as a given class's jar.
|
static boolean |
loadLibrary()
Loads the FFSampledSP library.
|
static void |
loadLibrary(String libName)
Loads a library.
|
static void |
loadLibrary(String libName,
Class<?> baseClass)
Loads a library.
|
public static boolean loadLibrary()
public static void loadLibrary(String libName)
libName
- name of the library, as described in System.loadLibrary(String)
);public static void loadLibrary(String libName, Class<?> baseClass)
libname-arch-host
, via the library path,
then (lib)libname-arch-*.ext
via the classpath,
then libname
via the library path,
and finally (lib)libname*.ext
via the classpath.libName
- name of the library, as described in System.loadLibrary(String)
);baseClass
- class that identifies the jarpublic static String findFile(String name, Class<?> baseClass, FileFilter filter) throws FileNotFoundException
name
- (partial) filenamebaseClass
- base classfilter
- filter that determines whether a file is a matchFileNotFoundException
- if a matching file cannot be foundCopyright © 2013–2023 tagtraum industries incorporated. All rights reserved.