public final class AsperaLibraryLoader extends Object
Modifier and Type | Class and Description |
---|---|
static class |
AsperaLibraryLoader.AsperaLibraryLoadException
An exception that represents a failed attempt to load the Aspera library
|
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log |
Constructor and Description |
---|
AsperaLibraryLoader() |
Modifier and Type | Method and Description |
---|---|
static JarFile |
createJar()
Creates an instance of JarFile which references the Aspera library
|
static void |
extractFile(JarFile jar,
JarEntry entry,
File destPath)
Extracts a jar entry from a jar file to a target location on the local file system
|
static void |
extractJar(JarFile jar,
File extractedLocation)
Creates a 1:1 copy of all contents from a jar file to the specified location on the local filesystem
|
static String |
jarVersion(JarFile jar)
Determines the version associated with this jar
|
static String |
load()
Prepares and loads the Aspera library in preparation for its use.
|
static void |
loadLibrary(File extractedPath,
List<String> candidates)
Loads a dynamic library into the JVM from a list of candidates
|
static List<String> |
osLibs()
Determine which os the jvm is running on
|
public static String load()
public static JarFile createJar() throws IOException, URISyntaxException
IOException
- if unable to create a JarFile referenceURISyntaxException
- if the location to the Aspera library is invalidpublic static String jarVersion(JarFile jar) throws IOException
jar
- Source jar to query version information fromIOException
- if unable to successfully query source jarpublic static void extractJar(JarFile jar, File extractedLocation) throws IOException
jar
- The source jar to extract contents fromextractedLocation
- The target location for extracted jar contentsIOException
- if jar extraction fails IOpublic static void extractFile(JarFile jar, JarEntry entry, File destPath) throws IOException
jar
- The jar in which the desired file residesentry
- The desired entry (file) to extract from the jardestPath
- The target location to extract the jar entry toIOException
- if any IO failure occurs during file extractionpublic static List<String> osLibs()
public static void loadLibrary(File extractedPath, List<String> candidates)
extractedPath
- The base directory where candidate dynamic libraries residecandidates
- A list of candidate dynamic library names for various platformsCopyright © 2024. All rights reserved.