public class DirectorySoSource extends SoSource
SoSource that finds shared libraries in a given directory.| Modifier and Type | Field and Description |
|---|---|
static int |
ON_LD_LIBRARY_PATH |
static int |
RESOLVE_DEPENDENCIES |
LOAD_FLAG_ALLOW_IMPLICIT_PROVISION, LOAD_FLAG_ALLOW_SOURCE_CHANGE, LOAD_FLAG_MIN_CUSTOM_FLAG, LOAD_RESULT_CORRUPTED_LIB_FILE, LOAD_RESULT_IMPLICITLY_PROVIDED, LOAD_RESULT_LOADED, LOAD_RESULT_NOT_FOUND, PREPARE_FLAG_ALLOW_ASYNC_INIT, PREPARE_FLAG_FORCE_REFRESH| Constructor and Description |
|---|
DirectorySoSource(java.io.File soDirectory,
int flags)
Make a new DirectorySoSource.
|
DirectorySoSource(java.io.File soDirectory,
int flags,
java.lang.String[] denyList)
This method is similar to
DirectorySoSource(File, int), with the following
differences: |
| Modifier and Type | Method and Description |
|---|---|
void |
addToLdLibraryPath(java.util.Collection<java.lang.String> paths)
Add an element to an LD_LIBRARY_PATH under construction.
|
java.lang.String[] |
getLibraryDependencies(java.lang.String soName)
Gets the dependencies of a library if it is found on this SoSource
|
java.lang.String |
getLibraryPath(java.lang.String soName)
Gets the full path of a library if it is found on this SoSource.
|
int |
loadLibrary(java.lang.String soName,
int loadFlags,
StrictMode.ThreadPolicy threadPolicy)
Load a shared library library into this process.
|
java.lang.String |
toString()
Return the class name of the actual instance.
|
java.io.File |
unpackLibrary(java.lang.String soName)
Ensure that a shared library exists on disk somewhere.
|
getSoSourceAbispublic static final int RESOLVE_DEPENDENCIES
public static final int ON_LD_LIBRARY_PATH
public DirectorySoSource(java.io.File soDirectory,
int flags)
flags contains RESOLVE_DEPENDENCIES,
recursively load dependencies for shared objects loaded from this directory. (We shouldn't need
to resolve dependencies for libraries loaded from system directories: the dynamic linker is
smart enough to do it on its own there.)public DirectorySoSource(java.io.File soDirectory,
int flags,
java.lang.String[] denyList)
DirectorySoSource(File, int), with the following
differences:denyList - the soname list that we won't try to load from this sourcepublic int loadLibrary(java.lang.String soName,
int loadFlags,
StrictMode.ThreadPolicy threadPolicy)
throws java.io.IOException
SoSourceSoSource.loadLibrary(java.lang.String, int, StrictMode.ThreadPolicy).loadLibrary in class SoSourcesoName - Name of library to loadloadFlags - Zero or more of the LOAD_FLAG_XXX constants.java.io.IOExceptionpublic java.lang.String getLibraryPath(java.lang.String soName)
throws java.io.IOException
SoSourcegetLibraryPath in class SoSourcesoName - the full file name of the libraryjava.io.IOException - if there is an error calculating soFileName's canonical pathpublic java.lang.String[] getLibraryDependencies(java.lang.String soName)
throws java.io.IOException
SoSourcegetLibraryDependencies in class SoSourcesoName - Name of library to inspectsoName needs for linkingjava.io.IOException - if soName is found but there is an error reading itpublic java.io.File unpackLibrary(java.lang.String soName)
throws java.io.IOException
SoSourceSoSource.loadLibrary(java.lang.String, int, StrictMode.ThreadPolicy).unpackLibrary in class SoSourcesoName - Name of library to loadnull if not.java.io.IOExceptionpublic void addToLdLibraryPath(java.util.Collection<java.lang.String> paths)
SoSourceaddToLdLibraryPath in class SoSourcepaths - Collection of paths to which to add