Package edu.wpi.first.util
Class RuntimeLoader<T>
- java.lang.Object
-
- edu.wpi.first.util.RuntimeLoader<T>
-
public final class RuntimeLoader<T> extends Object
-
-
Constructor Summary
Constructors Constructor Description RuntimeLoader(String libraryName, String extractionRoot, Class<T> cls)
Creates a new library loader.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String
getDefaultExtractionRoot()
Gets the default extration root location (~/.wpilib/nativecache).void
loadLibrary()
Loads a native library.void
loadLibraryHashed()
Load a native library by directly hashing the file.
-
-
-
Constructor Detail
-
RuntimeLoader
public RuntimeLoader(String libraryName, String extractionRoot, Class<T> cls)
Creates a new library loader.- Parameters:
libraryName
- Name of library to load.extractionRoot
- Location from which to load the library.cls
- Class whose classpath the given library belongs.
-
-
Method Detail
-
getDefaultExtractionRoot
public static String getDefaultExtractionRoot()
Gets the default extration root location (~/.wpilib/nativecache).- Returns:
- The default extraction root location.
-
loadLibrary
public void loadLibrary() throws IOException
Loads a native library.- Throws:
IOException
- if the library fails to load
-
loadLibraryHashed
public void loadLibraryHashed() throws IOException
Load a native library by directly hashing the file.- Throws:
IOException
- if the library failed to load
-
-