public class UnixUser extends Object
Constructor and Description |
---|
UnixUser(int uid)
Looks up a user according to the user's UID.
|
UnixUser(String loginName)
Looks up a user according to the user name.
|
Modifier and Type | Method and Description |
---|---|
String |
getEffective() |
int |
getEGid()
Returns the effective group ID number for the user.
|
int |
getEUid()
Returns the effective user ID number for the user.
|
int |
getGid()
Returns the group ID number for the user.
|
String |
getHome()
Returns the home directory of the user.
|
String |
getLoginName()
Returns the login name of the user.
|
String |
getName()
Returns the real name of the user.
|
String |
getShell()
Returns the shell used by the user.
|
int |
getUid()
Returns the user ID number for the user.
|
static int |
initGroups(String name,
int gid)
assigns secondary groups
|
static int |
setEGid(int gid)
Sets the effective group ID
|
static int |
setEUid(int uid)
Sets the effective user ID
|
static int |
setGid(int gid)
Sets the real group ID
|
static int |
setReGid(int rgid,
int egid)
Sets the real and effective group ID
|
static int |
setReUid(int ruid,
int euid)
Sets the real and effective user ID
|
static int |
setUid(int uid)
Sets the real user ID
|
String |
toString() |
static UnixUser |
whoami()
Returns a user object for the current user.
|
public static final int SUCCESS
public static final int FAILURE
public UnixUser(String loginName) throws IllegalArgumentException
IllegalArgumentException
public UnixUser(int uid) throws IllegalArgumentException
IllegalArgumentException
public static UnixUser whoami()
public String getHome()
public String getLoginName()
public String getName()
public String getShell()
public int getUid()
public int getGid()
public int getEUid()
public int getEGid()
public static int setUid(int uid)
public static int setEUid(int uid)
public static int setReUid(int ruid, int euid)
public static int setGid(int gid)
public static int setEGid(int gid)
public static int setReGid(int rgid, int egid)
public static int initGroups(String name, int gid)
public String getEffective()
Copyright © 2010–2016 UNICORE. All rights reserved.