Klasse NativeLibraryLoader

java.lang.Object
com.github.hypfvieh.system.NativeLibraryLoader

public final class NativeLibraryLoader extends Object
Helper class to load a native library either from a given path, the classpath or system library path.
  • Methodendetails

    • isEnabled

      public static boolean isEnabled()
      Check if NativeLibraryLoader will 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

      public static void loadLibrary(String _libName, SearchOrder[] _loadOrder, String... _searchPathes)
      Tries to load the given library using the given load/search order.
      Parameter:
      _libName - library name
      _loadOrder - load order
      _searchPathes - search pathes
    • getFileExtension

      public static String getFileExtension(String _fileName)
      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