Top Description Constructors Methods
com.sun.star.lib.util

public final Class NativeLibraryLoader

extends Object
Class Inheritance
Imports
java.io.File, java.net.URL, .URLClassLoader

Helper functions to locate and load native files.

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.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static File

Returns:

a File locating the resource, or null if the resource was not found.
getResource
(ClassLoader
a class loader; may be null.
loader
,
String
a resource name (that is, the name of a file).
name
)

Locate a system resource, using a given class loader.

public static void
loadLibrary(ClassLoader
a class loader; may be null.
loader
,
String
the library name; how this name is mapped to a system library name is system dependent.
libname
)

Load a system library, using a given class loader to locate the library.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

NativeLibraryLoaderback to summary
private NativeLibraryLoader()

Method Detail

getResourceback to summary
public static File getResource(ClassLoader loader, String name)

Locate a system resource, using a given class loader.

This is similar to ClassLoader.getResource, but only works for local resources (local files), and adds additional functionality for URLClassLoaders.

Parameters
loader:ClassLoader

a class loader; may be null.

name:String

a resource name (that is, the name of a file).

Returns:File

a File locating the resource, or null if the resource was not found.

loadLibraryback to summary
public static void loadLibrary(ClassLoader loader, String libname)

Load a system library, using a given class loader to locate the library.

This is similar to System.loadLibrary.

Parameters
loader:ClassLoader

a class loader; may be null.

libname:String

the library name; how this name is mapped to a system library name is system dependent.