Loads the requested library. If the library is already loaded, this method returns
immediately, without an attempt to load the library again.
Invocation Example: This assumes that the call is made from the class that links with
the library. If this is not the case,
this
must be replaced by the reference
of the class that links with the library.
Librarian.getInstance ().loadLibrary ("MyLibrary", this);
Loading of a native library file works as follows:
- If the library is already loaded there is nothing to do.
- An attempt is made to load the library by its name. If there is no system path set to
the library, this attempt will fail.
- If the client is located on the local file system, an attempt is made to load the
library from the local files system as well.
- If the library is located inside a *.jar file, it is extracted to 'java.io.tmpdir' and
an attempt is made to load it from there.
Loading from the local file system and from the *.jar file is attempted for the following
potential locations of the library in this order:
- The same directory where the client is located
- The native library directory