Class NativeLibraryLoader


  • public class NativeLibraryLoader
    extends java.lang.Object
    Separate class, so we can mock BoxStore.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String OBJECTBOX_JNI  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static void checkUnpackLib​(java.lang.String filename)  
      static void ensureLoaded()  
      private static java.lang.String getCpuArch()
      Get CPU architecture of the JVM (Note: this can not be used for Android, Android decides arch on its own and looks for library in appropriately named folder).
      private static java.lang.String getCpuArchOSOrNull()
      Get architecture using operating system tools.
      private static java.lang.String getSupportedABIsAndroid()
      Return a string containing a list of ABIs that are supported by the current Android device.
      private static boolean loadLibraryAndroid()  
      • Methods inherited from class java.lang.Object

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

      • NativeLibraryLoader

        public NativeLibraryLoader()
    • Method Detail

      • getCpuArch

        private static java.lang.String getCpuArch()
        Get CPU architecture of the JVM (Note: this can not be used for Android, Android decides arch on its own and looks for library in appropriately named folder).

        Note that this may not be the architecture of the actual hardware (e.g. when running a x86 JVM on an amd64 machine).

      • getCpuArchOSOrNull

        @Nullable
        private static java.lang.String getCpuArchOSOrNull()
        Get architecture using operating system tools. Currently only Linux is supported (using uname).
      • checkUnpackLib

        private static void checkUnpackLib​(java.lang.String filename)
      • loadLibraryAndroid

        private static boolean loadLibraryAndroid()
      • getSupportedABIsAndroid

        @Nonnull
        private static java.lang.String getSupportedABIsAndroid()
        Return a string containing a list of ABIs that are supported by the current Android device. If the Android device is below API level 21 (Android 5) or if looking up the value fails, returns an empty string.
      • ensureLoaded

        public static void ensureLoaded()