类 NativeLibraryLoader

java.lang.Object
io.github.weg2022.strguard.runtime.NativeLibraryLoader

public final class NativeLibraryLoader extends Object
Extracts, verifies, and loads a bundled Native library for a generated bridge class.
  • 方法概要

    修饰符和类型
    方法
    说明
    static String
    extract(Class<?> anchor, String resourcePath, String fileName, String markerResourcePath)
    Finds matching binary and marker resources in one classpath container, verifies the binary hash while extracting it, and returns the resulting absolute path.
    static void
    load(Class<?> anchor, String resourcePath, String fileName, String markerResourcePath)
    Verifies and loads the Native binary without exposing a hash-to-load gap to generated bridge code.
    static void
    loaded(String path)
    Deletes an extracted library where the host OS permits it.

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 方法详细资料

    • load

      public static void load(Class<?> anchor, String resourcePath, String fileName, String markerResourcePath)
      Verifies and loads the Native binary without exposing a hash-to-load gap to generated bridge code.
      参数:
      anchor - generated bridge class used to resolve classpath containers
      resourcePath - validated Native binary resource path
      fileName - generated Native library file name
      markerResourcePath - artifact marker paired with the Native binary
    • extract

      public static String extract(Class<?> anchor, String resourcePath, String fileName, String markerResourcePath)
      Finds matching binary and marker resources in one classpath container, verifies the binary hash while extracting it, and returns the resulting absolute path.
      参数:
      anchor - generated bridge class used to resolve classpath containers
      resourcePath - validated Native binary resource path
      fileName - generated Native library file name
      markerResourcePath - artifact marker paired with the Native binary
      返回:
      absolute path to the verified private extraction
    • loaded

      public static void loaded(String path)
      Deletes an extracted library where the host OS permits it.
      参数:
      path - absolute path returned by extract(Class, String, String, String)