Skip to content

Commit a99a7d1

Browse files
committed
Doc updates
1 parent 9a77baa commit a99a7d1

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

wiki/examples/LibraryLoading.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
As of version 2.0, JNativeHook includes a native library loading interface called [NativeLibraryLocator](../../src/java/org/jnativehook/NativeLibraryLocator.java).
33
You can implement this interface to customize what libraries are loaded, as well as where they are loaded from.
44

5-
```
5+
```java
66
public class UrlLibraryLocator implements NativeLibraryLocator {
77
public Iterator<File> getLibraries() {
88
String libName = "MyLibrary";
99

1010
// Get what the system "thinks" the library name should be.
11-
String libNativeName = System.mapLibraryName(libName);
12-
13-
// Hack for OS X JRE 1.6 and earlier.
14-
libNativeName = libNativeName.replaceAll("\\.jnilib$", "\\.dylib");
15-
16-
String libExt = libNativeName.substring(libNativeName.lastIndexOf('.'));
17-
11+
String libNativeName = System.mapLibraryName(libName);
12+
13+
// Hack for OS X JRE 1.6 and earlier.
14+
libNativeName = libNativeName.replaceAll("\\.jnilib$", "\\.dylib");
15+
16+
String libExt = libNativeName.substring(libNativeName.lastIndexOf('.'));
17+
1818
URL libUrl = new URL("http://www.mydomain.told/pathToFile/" + libNativeName);
1919
File libFile = File.createTempFile(tempFile, libExt);
20-
20+
2121
libFile.deleteOnExit();
2222

2323
FileUtils.copyURLToFile(libUrl, libFile);

0 commit comments

Comments
 (0)