Package jnr.posix
Class POSIXFactory
- java.lang.Object
-
- jnr.posix.POSIXFactory
-
public class POSIXFactory extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static jnr.ffi.Platform
NATIVE_PLATFORM
static java.lang.String
STANDARD_C_LIBRARY_NAME
-
Constructor Summary
Constructors Constructor Description POSIXFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static POSIX
getJavaPOSIX()
Get a pure-Java POSIX instance.static POSIX
getJavaPOSIX(POSIXHandler handler)
Get a pure-Java POSIX instance.static POSIX
getNativePOSIX()
Get a POSIX instance.static POSIX
getNativePOSIX(POSIXHandler handler)
Get a POSIX instance.static POSIX
getPOSIX()
This will useDefaultPOSIXHandler
and the native POSIX implementation, falling back on the pure-Java implementation if native support is not available.static POSIX
getPOSIX(POSIXHandler handler, boolean useNativePOSIX)
Get a POSIX instance.static POSIX
loadAixPOSIX(POSIXHandler handler)
static POSIX
loadDragonFlyPOSIX(POSIXHandler handler)
static POSIX
loadFreeBSDPOSIX(POSIXHandler handler)
static POSIX
loadLinuxPOSIX(POSIXHandler handler)
static POSIX
loadMacOSPOSIX(POSIXHandler handler)
static POSIX
loadOpenBSDPOSIX(POSIXHandler handler)
static POSIX
loadSolarisPOSIX(POSIXHandler handler)
static POSIX
loadWindowsPOSIX(POSIXHandler handler)
-
-
-
Method Detail
-
getPOSIX
public static POSIX getPOSIX(POSIXHandler handler, boolean useNativePOSIX)
Get a POSIX instance. If useNativePosix is true, this works just like POSIXFactory#getPOSIX(). If useNativePosix is false, this works like POSIXFactory#getJavaPOSIX()- Parameters:
handler
- a POSIXHandler implementationuseNativePOSIX
- whether to attempt to use native code for better functionality- Returns:
- a POSIX implementation, attempting to use native code if useNativePosix is true
-
getPOSIX
public static POSIX getPOSIX()
This will useDefaultPOSIXHandler
and the native POSIX implementation, falling back on the pure-Java implementation if native support is not available.- Returns:
- a POSIX implementation, native if possible and pure-Java otherwise.
-
getJavaPOSIX
public static POSIX getJavaPOSIX(POSIXHandler handler)
Get a pure-Java POSIX instance. Functionality will be limited to that which can be provided by pure-Java/JDK features or shelling out to external commands.- Parameters:
handler
- a POSIXHandler implementation- Returns:
- a pure-Java POSIX implementation
-
getJavaPOSIX
public static POSIX getJavaPOSIX()
Get a pure-Java POSIX instance. Functionality will be limited to that which can be provided by pure-Java/JDK features or shelling out to external commands.- Returns:
- a pure-Java POSIX implementation
-
getNativePOSIX
public static POSIX getNativePOSIX(POSIXHandler handler)
Get a POSIX instance. If a true native implementation can't be loaded, allow that error to propagate rather than falling back on the pure-Java version.- Parameters:
handler
- a POSIXHandler implementation- Returns:
- a native POSIX implementation, raising errors if the native version can't load
-
getNativePOSIX
public static POSIX getNativePOSIX()
Get a POSIX instance. If a true native implementation can't be loaded, allow that error to propagate rather than falling back on the pure-Java version.- Returns:
- a native POSIX implementation, raising errors if the native version can't load
-
loadLinuxPOSIX
public static POSIX loadLinuxPOSIX(POSIXHandler handler)
-
loadMacOSPOSIX
public static POSIX loadMacOSPOSIX(POSIXHandler handler)
-
loadSolarisPOSIX
public static POSIX loadSolarisPOSIX(POSIXHandler handler)
-
loadFreeBSDPOSIX
public static POSIX loadFreeBSDPOSIX(POSIXHandler handler)
-
loadDragonFlyPOSIX
public static POSIX loadDragonFlyPOSIX(POSIXHandler handler)
-
loadOpenBSDPOSIX
public static POSIX loadOpenBSDPOSIX(POSIXHandler handler)
-
loadWindowsPOSIX
public static POSIX loadWindowsPOSIX(POSIXHandler handler)
-
loadAixPOSIX
public static POSIX loadAixPOSIX(POSIXHandler handler)
-
-