Package jnr.posix

Class POSIXFactory


  • public class POSIXFactory
    extends java.lang.Object
    • Field Detail

      • NATIVE_PLATFORM

        public static final jnr.ffi.Platform NATIVE_PLATFORM
      • STANDARD_C_LIBRARY_NAME

        public static final java.lang.String STANDARD_C_LIBRARY_NAME
    • Constructor Detail

      • POSIXFactory

        public POSIXFactory()
    • 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 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
      • loadDragonFlyPOSIX

        public static POSIX loadDragonFlyPOSIX​(POSIXHandler handler)