Package org.apache.tomcat.jni
Class User
java.lang.Object
org.apache.tomcat.jni.User
User
- Author:
- Mladen Turk
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic longGet the groupid for a specified group name This function is available only if APR_HAS_USER is defined.static intgidcompare(long left, long right) Compare two group identifiers for equality.static longgidCurrent(long p) Get the groupid of the calling process This function is available only if APR_HAS_USER is defined.static Stringgroupname(long groupid, long p) Get the group name for a specified groupid This function is available only if APR_HAS_USER is defined.static StringGet the home directory for the named user This function is available only if APR_HAS_USER is defined.static longGet the userid for the specified username This function is available only if APR_HAS_USER is defined.static intuidcompare(long left, long right) Compare two user identifiers for equality.static longuidCurrent(long p) Get the userid (and groupid) of the calling process This function is available only if APR_HAS_USER is defined.static longGet the groupid for the specified username This function is available only if APR_HAS_USER is defined.static Stringusername(long userid, long p) Get the user name for a specified userid This function is available only if APR_HAS_USER is defined.
-
Constructor Details
-
User
public User()
-
-
Method Details
-
uidCurrent
Get the userid (and groupid) of the calling process This function is available only if APR_HAS_USER is defined.- Parameters:
p- The pool from which to allocate working space- Returns:
- Returns the user id
- Throws:
Error- If an error occurred
-
gidCurrent
Get the groupid of the calling process This function is available only if APR_HAS_USER is defined.- Parameters:
p- The pool from which to allocate working space- Returns:
- Returns the group id
- Throws:
Error- If an error occurred
-
uid
Get the userid for the specified username This function is available only if APR_HAS_USER is defined.- Parameters:
username- The username to lookupp- The pool from which to allocate working space- Returns:
- Returns the user id
- Throws:
Error- If an error occurred
-
usergid
Get the groupid for the specified username This function is available only if APR_HAS_USER is defined.- Parameters:
username- The username to lookupp- The pool from which to allocate working space- Returns:
- Returns the user's group id
- Throws:
Error- If an error occurred
-
gid
Get the groupid for a specified group name This function is available only if APR_HAS_USER is defined.- Parameters:
groupname- The group name to look upp- The pool from which to allocate working space- Returns:
- Returns the user's group id
- Throws:
Error- If an error occurred
-
username
Get the user name for a specified userid This function is available only if APR_HAS_USER is defined.- Parameters:
userid- The useridp- The pool from which to allocate the string- Returns:
- New string containing user name
- Throws:
Error- If an error occurred
-
groupname
Get the group name for a specified groupid This function is available only if APR_HAS_USER is defined.- Parameters:
groupid- The groupidp- The pool from which to allocate the string- Returns:
- New string containing group name
- Throws:
Error- If an error occurred
-
uidcompare
public static int uidcompare(long left, long right) Compare two user identifiers for equality. This function is available only if APR_HAS_USER is defined.- Parameters:
left- One uid to testright- Another uid to test- Returns:
- APR_SUCCESS if the apr_uid_t structures identify the same user, APR_EMISMATCH if not, APR_BADARG if an apr_uid_t is invalid.
-
gidcompare
public static int gidcompare(long left, long right) Compare two group identifiers for equality. This function is available only if APR_HAS_USER is defined.- Parameters:
left- One gid to testright- Another gid to test- Returns:
- APR_SUCCESS if the apr_gid_t structures identify the same group, APR_EMISMATCH if not, APR_BADARG if an apr_gid_t is invalid.
-
homepath
Get the home directory for the named user This function is available only if APR_HAS_USER is defined.- Parameters:
username- The named userp- The pool from which to allocate the string- Returns:
- New string containing directory name
- Throws:
Error- If an error occurred
-