com.gridsystems.utils
Class JNIUtils

java.lang.Object
  extended by com.gridsystems.utils.JNIUtils

public final class JNIUtils
extends java.lang.Object

Utility methods for JNI.

Author:
Xmas

Method Summary
static java.io.File extractDynamicLibrary(java.lang.String dynamiclibraryname, java.lang.Class<?> pathclass)
          Extracts a Dynamic library of a jar file and load into memory.
static java.io.File extractDynamicLibrary(java.lang.String dynamiclibraryname, java.lang.String path)
          Extracts a Dynamic library of a jar file and loads it into memory.
static java.lang.String[] getNativePrefixPostfix(java.lang.String os)
          Return prefix and postfix of the dinamic libraries name in the operating system 'os'.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getNativePrefixPostfix

public static java.lang.String[] getNativePrefixPostfix(java.lang.String os)
Return prefix and postfix of the dinamic libraries name in the operating system 'os'.

Parameters:
os - the operating system
Returns:
A string array of lenght 2: position 0 contains prefix and position 1 contains posfix of dinamic library.

extractDynamicLibrary

public static java.io.File extractDynamicLibrary(java.lang.String dynamiclibraryname,
                                                 java.lang.Class<?> pathclass)
                                          throws java.lang.Exception
Extracts a Dynamic library of a jar file and load into memory.

Parameters:
dynamiclibraryname - the DL name
pathclass - the path class
Returns:
Path to file extracted.
Throws:
java.lang.Exception - if error

extractDynamicLibrary

public static java.io.File extractDynamicLibrary(java.lang.String dynamiclibraryname,
                                                 java.lang.String path)
                                          throws java.lang.Exception
Extracts a Dynamic library of a jar file and loads it into memory.

Parameters:
dynamiclibraryname - the DL name
path - the path
Returns:
Path to file extracted.
Throws:
java.lang.Exception - if error


Copyright © 2007-2008 Grid Systems, S.A.. All Rights Reserved.