Package ucar.nc2.ffi.netcdf
Class NetcdfClibrary
- java.lang.Object
-
- ucar.nc2.ffi.netcdf.NetcdfClibrary
-
public class NetcdfClibrary extends Object
Static methods to load the netcdf C library.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Nc4prototypes
getForeignFunctionInterface()
Get the interface to the Nectdf C library.static String
getVersion()
Get the version of the loaded Nectdf C library.static boolean
isLibraryPresent()
Test if the netcdf C library is present and loadedstatic void
setLibraryNameAndPath(String jna_path, String lib_name)
Set the path and name of the netcdf c library.static int
setLogLevel(int level)
Set the log level for Netcdf C library.
-
-
-
Method Detail
-
setLibraryNameAndPath
public static void setLibraryNameAndPath(@Nullable String jna_path, @Nullable String lib_name)
Set the path and name of the netcdf c library. Must be called before load() is called.- Parameters:
jna_path
- path to shared libraries, may be null. If null, will look for system property "jna.library.path", then environment variable "JNA_PATH". If set, will set the environment variable "JNA_PATH".lib_name
- library name, may be null. If null, will use "netcdf".
-
isLibraryPresent
public static boolean isLibraryPresent()
Test if the netcdf C library is present and loaded- Returns:
- true if present
-
getForeignFunctionInterface
public static Nc4prototypes getForeignFunctionInterface()
Get the interface to the Nectdf C library.
-
getVersion
@Nullable public static String getVersion()
Get the version of the loaded Nectdf C library. Call isClibraryPresent() first.
-
setLogLevel
public static int setLogLevel(int level)
Set the log level for Netcdf C library. This calls the Netcdf C library nc_set_log_level() method. If the system property "jna.library.loglevel" is set, that is the default, this method overrides it.- Returns:
- the previous level, as returned from nc_set_log_level().
-
-