The libraries may be packed in JAR files, in which case they will be extracted to a temporary directory and that directory will be prepended to
Configuration#LIBRARY_PATH.
Configuration#SHARED_LIBRARY_EXTRACT_DIRECTORY, Configuration#SHARED_LIBRARY_EXTRACT_PATH
| Modifier and Type | Field and Description |
|---|---|
| private static boolean | |
| private static final Lock | |
| private static Path | |
| private static HashSet |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static boolean | |
| private static void | |
| private static long | |
| private static FileChannel | Returns: aFileChannel that has locked the resourcethe extracted file file, URL the resource to extract resource)Extracts a native library resource if it does not already exist or the CRC does not match. |
| private static Path | Returns: the extracted librarythe resource filename filename, URL resource, Consumer<String> load)Returns a path to a file that can be written. |
| private static void | |
| pack-priv static FileChannel | Returns: aFileChannel that has locked the resource filethe resource name name, String the resource filename filename, URL the classpath resource, Consumer<String> URL were the resource can be foundshould call load)System::load in the context of the appropriate ClassLoaderExtracts the specified shared library or native resource from the classpath to a temporary directory. |
| private static FileChannel | |
| private static void |
| checkedJDK8195129 | back to summary |
|---|---|
| private static boolean checkedJDK8195129 | |
| EXTRACT_PATH_LOCK | back to summary |
|---|---|
| private static final Lock EXTRACT_PATH_LOCK | |
| extractPath | back to summary |
|---|---|
private static Path extractPath
| |
| extractPaths | back to summary |
|---|---|
| private static HashSet<Path> extractPaths | |
| SharedLibraryLoader | back to summary |
|---|---|
| private SharedLibraryLoader() | |
| canWrite | back to summary |
|---|---|
| private static boolean canWrite(Path root, Path file, URL resource, Consumer<String> load) Returns true if the parent directories of the file can be created and the file can be written.
| |
| canWriteCleanup | back to summary |
|---|---|
| private static void canWriteCleanup(Path root, Path file) | |
| crc | back to summary |
|---|---|
| private static long crc(InputStream input) throws IOException Returns a CRC of the remaining bytes in a stream.
| |
| extract | back to summary |
|---|---|
| private static FileChannel extract(Path file, URL resource) throws IOException Extracts a native library resource if it does not already exist or the CRC does not match.
| |
| getExtractPath | back to summary |
|---|---|
| private static Path getExtractPath(String filename, URL resource, Consumer<String> load) Returns a path to a file that can be written. Tries multiple locations and verifies writing succeeds. | |
| initExtractPath | back to summary |
|---|---|
| private static void initExtractPath(Path extractPath) | |
| load | back to summary |
|---|---|
| pack-priv static FileChannel load(String name, String filename, URL resource, Consumer<String> load) Extracts the specified shared library or native resource from the classpath to a temporary directory.
| |
| lock | back to summary |
|---|---|
| private static FileChannel lock(Path file) Locks a file.
| |
| workaroundJDK8195129 | back to summary |
|---|---|
| private static void workaroundJDK8195129(Path file, URL resource, Consumer<String> load) throws Throwable | |