    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class w3c.util.Unix

    java.lang.Object
       |
       +----w3c.util.Unix

public class Unix
extends Object

Native methods to do some UNIX specific system calls. This class can be used on UNIX variants to access some specific system calls.

##

Unix()

##

chroot(String)
  Change the process root, using `chroot` system call.
getGID(String)
  Get the identifier for that group.
getUID(String)
  Get the identifier for that user.
getUnix()
  Get the UNIX system call manger.
isResolved()
  Can I perform UNIX system calls through that instance ?
setGID(int)
  Set the group id for the running process.
setUID(int)
  Set the user id for the running process.

##

Unix

     public Unix()

##

getUnix

     public static synchronized Unix getUnix()

  Get the UNIX system call manger.

  Returns:
    An instance of this class, suitable to call UNIX system calls.

isResolved

     public boolean isResolved()

  Can I perform UNIX system calls through that instance ?

  Returns:
    A boolean, true if these system calls are allowed, false otherwise.

getUID

     public int getUID(String uname)

  Get the identifier for that user.

  Returns:
    The user's identifier, or -1 if user was not found.

getGID

     public int getGID(String gname)

  Get the identifier for that group.

  Returns:
    The group identifier, or -1 if not found.

setUID

     public void setUID(int uid) throws UnixException

  Set the user id for the running process.

  Parameters:
    uid - The new user identifier for the process.
  Throws: UnixException
    If failed.

setGID

     public void setGID(int gid) throws UnixException

  Set the group id for the running process.

  Parameters:
    gid - The new user identifier for the process.
  Throws: UnixException
    If failed.

chroot

     public void chroot(String root) throws UnixException

  Change the process root, using `chroot` system call.

  Parameters:
    root - The new root for the process.

    All Packages  Class Hierarchy  This Package  Previous  Next  Index