public final class NativeLibraryLoader extends Object
The methods in this class are designed to find the requested resources in as many cases as possible. They search various places, roughly from most specific to most general. This works well if a component is known to bring with it a certain resource, and that resource has to be found. However, it might not work very well in cases where you want to check whether a component brings with it a certain resource or not: a similarly named resource from another component might be found by the eager search algorithm.
| Modifier and Type | Method and Description |
|---|---|
static File |
getResource(ClassLoader loader,
String name)
Locate a system resource, using a given class loader.
|
static void |
loadLibrary(ClassLoader loader,
String libname)
Load a system library, using a given class loader to locate the library.
|
public static void loadLibrary(ClassLoader loader, String libname)
This is similar to System.loadLibrary.
loader - a class loader; may be null.libname - the library name; how this name is mapped to a system
library name is system dependent.public static File getResource(ClassLoader loader, String name)
This is similar to ClassLoader.getResource, but only works
for local resources (local files), and adds additional functionality for
URLClassLoaders.
loader - a class loader; may be null.name - a resource name (that is, the name of a file).