|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jniwrapper.DefaultLibraryLoader
Default implementation for LibraryLoader
that realizes Singleton
pattern. Paths for searching libraries can be added via the
addPath()
methods. The instance of this class can be obtained
via getInstance()
.
Method Summary | |
void |
addPath(java.io.File directory)
Adds a directory to the path for searching libraries. |
void |
addPath(java.util.List directories)
Adds a directory list to the path for searching libraries. |
void |
addPath(java.lang.String path)
Adds a colon-separated path. |
java.io.File |
findLibrary(java.lang.String name)
Finds a library by its name. |
static DefaultLibraryLoader |
getInstance()
Returns a Singleton instance. |
static java.lang.String |
getLibraryExtension()
Returns a file extension for native code libraries used under a current platform. |
void |
loadLibrary(java.lang.String name)
Loads a native library by its name. |
static java.lang.String |
mapLibraryName(java.lang.String libName)
Maps a libary name to a platform-specific file name. |
void |
prependPath(java.io.File directory)
Adds a directory to the path for searching libraries. |
static java.lang.String |
urlToPath(java.net.URL url)
Converts the URL with specified symbols (such as %20, %2B etc.) to the appropriate chars. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static DefaultLibraryLoader getInstance()
public void addPath(java.io.File directory)
directory
- a directory to the path for searching librariespublic void prependPath(java.io.File directory)
directory
- a directory to the path for searching librariespublic void addPath(java.util.List directories)
directories
- a directory list to the path for searching librariespublic void addPath(java.lang.String path)
path
- a colon-separated pathpublic java.io.File findLibrary(java.lang.String name)
findLibrary
in interface LibraryLoader
public static java.lang.String urlToPath(java.net.URL url)
url
- the URL with specified symbols (such as %20, %2B etc.)
public void loadLibrary(java.lang.String name)
loadLibrary
in interface LibraryLoader
public static java.lang.String mapLibraryName(java.lang.String libName)
libName
- a specified library name
public static java.lang.String getLibraryExtension()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |