Package jnr.posix

Class POSIXFactory

java.lang.Object
jnr.posix.POSIXFactory

public class POSIXFactory extends Object
  • Field Details

    • NATIVE_PLATFORM

      public static final jnr.ffi.Platform NATIVE_PLATFORM
    • STANDARD_C_LIBRARY_NAME

      public static final String STANDARD_C_LIBRARY_NAME
  • Constructor Details

    • POSIXFactory

      public POSIXFactory()
  • Method Details

    • 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 implementation
      useNativePOSIX - 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 use DefaultPOSIXHandler 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)