public class NativeLoader
extends java.lang.Object
FileTreeView
. On OSX, it also provides a native interface to the apple file system
api. The loader will first try to load the library using System.loadLibrary, which will succeed
if the library is present in the (DY)LD_LIBRARY_PATH. Otherwise the loader extracts the packaged
library (.so, .dll or .dylib) to a temporary directory and loads it from there. On jvm shutdown,
it marks the extracted library for deletion. It will generally be deleted the next time a
different jvm loads the library.
This class is not intended to be used outside of com.swoval.files, but it doesn't belong in that package, so it has to be public here.
Constructor and Description |
---|
NativeLoader() |
Modifier and Type | Method and Description |
---|---|
static void |
loadPackaged()
Loads the
swoval-files0 shared library. |
public static void loadPackaged() throws java.io.IOException, java.lang.UnsatisfiedLinkError
swoval-files0
shared library. It will first try to load the library from
the system library path and fallback to extracting a platform-specific jar to a temporary
directory.java.io.IOException
- if the packaged native binary cannot be written to a temp directory.java.lang.UnsatisfiedLinkError
- if no compatible binary for the platform is present.