Class NativeLibraryPathResolver


  • public class NativeLibraryPathResolver
    extends java.lang.Object
    Resolves file paths to native libraries based on the following file structure:

     /native/$os/$arch/native_lib_filename
     

    Valid $os values include:

    • win
    • linux
    • osx
    • hpux

    Valid $arch values include:

    • x86
    • x64
    • arm
    • itanium

    This directory structure is used to load native library exports out of jar files.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getPlatformNativeSuffix()
      Returns the native suffix, along with the ".", eg ".dll"
      static java.lang.String resolvePath​(java.lang.String filename)
      Resolve the path to filename based on the current Platform.
      static java.lang.String resolvePath​(java.lang.String filename, Platform platform)
      Resolve the path to filename based on the given Platform.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NativeLibraryPathResolver

        public NativeLibraryPathResolver()
    • Method Detail

      • resolvePath

        public static java.lang.String resolvePath​(java.lang.String filename)
        Resolve the path to filename based on the current Platform.
        Parameters:
        filename - The name of the native library file.
        Returns:
        The path to the native library, taking into account the current Platform.
      • resolvePath

        public static java.lang.String resolvePath​(java.lang.String filename,
                                                   Platform platform)
        Resolve the path to filename based on the given Platform.
        Parameters:
        filename - The name of the native library file.
        platform - The Platform to take into account.
        Returns:
        The path to the native library, taking into account the given Platform.
      • getPlatformNativeSuffix

        public static java.lang.String getPlatformNativeSuffix()
        Returns the native suffix, along with the ".", eg ".dll"