Class NativeLib

java.lang.Object
ai.catboost.common.NativeLib

public class NativeLib extends Object
  • Field Details

    • logger

      private static final org.slf4j.Logger logger
    • LOCK_EXT

      private static final String LOCK_EXT
      See Also:
  • Constructor Details

    • NativeLib

      public NativeLib()
  • Method Details

    • smartLoad

      public static void smartLoad(@Nonnull String libName) throws IOException
      Load libName, first will try try to load libName from default location then will try to load library from JAR.
      Parameters:
      libName -
      Throws:
      IOException
    • getCurrentMachineResourcesDirs

      @Nonnull private static String[] getCurrentMachineResourcesDirs()
    • loadNativeLibraryFromJar

      private static void loadNativeLibraryFromJar(@Nonnull String libName) throws IOException
      Throws:
      IOException
    • copyFileFromJar

      private static void copyFileFromJar(@Nonnull String pathWithinJar, @Nonnull String pathOnDisk) throws IOException
      Throws:
      IOException
    • createTemporaryFileFromJar

      @Nonnull private static String createTemporaryFileFromJar(@Nonnull String pathWithinJar) throws IOException, IllegalArgumentException
      Throws:
      IOException
      IllegalArgumentException
    • cleanup

      private static void cleanup(@Nonnull String libName)
      Delete old native libraries