java.lang.Object
com.github.hypfvieh.system.NativeLibraryLoader
Helper class to load a native library either from a given path, the classpath or system library path.
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic StringgetFileExtension(String _fileName) Extracts the file extension (part behind last dot of a filename).static booleanCheck ifNativeLibraryLoaderwill is active and will load libraries.static voidloadLibrary(boolean _trySystemLibsFirst, String _libName, String... _searchPathes) Load the given _libName from one of the given pathes (will search for the library and uses first match).static voidloadLibrary(String _libName, SearchOrder[] _loadOrder, String... _searchPathes) Tries to load the given library using the given load/search order.static voidsetEnabled(boolean _enabled) Enable/Disable library loading.
-
Methodendetails
-
isEnabled
public static boolean isEnabled()Check ifNativeLibraryLoaderwill is active and will load libraries.- Gibt zurück:
- true if enabled, false otherwise
-
setEnabled
public static void setEnabled(boolean _enabled) Enable/Disable library loading.- Parameter:
_enabled- enables/disable library loading
-
loadLibrary
public static void loadLibrary(boolean _trySystemLibsFirst, String _libName, String... _searchPathes) Load the given _libName from one of the given pathes (will search for the library and uses first match).- Parameter:
_trySystemLibsFirst- use system pathes first_libName- library to load_searchPathes- pathes to search
-
loadLibrary
Tries to load the given library using the given load/search order.- Parameter:
_libName- library name_loadOrder- load order_searchPathes- search pathes
-
getFileExtension
Extracts the file extension (part behind last dot of a filename). Only returns the extension, without the leading dot.- Parameter:
_fileName- filename- Gibt zurück:
- extension, empty string if not dot was found in filename or null if given String was null
-