Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   *  Licensed to the Apache Software Foundation (ASF) under one or more
   *  contributor license agreements.  See the NOTICE file distributed with
   *  this work for additional information regarding copyright ownership.
   *  The ASF licenses this file to You under the Apache License, Version 2.0
   *  (the "License"); you may not use this file except in compliance with
   *  the License.  You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
  *
  *  Unless required by applicable law or agreed to in writing, software
  *  distributed under the License is distributed on an "AS IS" BASIS,
  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
 
 package org.apache.tomcat.jni;

User

Author(s):
Mladen Turk
Version:
$Revision: 515 $, $Date: 2008-03-17 22:02:23 +0100 (Mon, 17 Mar 2008) $
 
 
 public class User {

    
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
 
      public static native long uidCurrent(long p)
         throws Error;

    
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
 
      public static native long gidCurrent(long p)
         throws Error;


    
Get the userid for the specified username This function is available only if APR_HAS_USER is defined.

Parameters:
username The username to lookup
p The pool from which to allocate working space
Returns:
Returns the user id
 
      public static native long uid(String usernamelong p)
         throws Error;

    
Get the groupid for the specified username This function is available only if APR_HAS_USER is defined.

Parameters:
username The username to lookup
p The pool from which to allocate working space
Returns:
Returns the user's group id
 
      public static native long usergid(String usernamelong p)
         throws Error;

    
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 up
p The pool from which to allocate working space
Returns:
Returns the user's group id
 
      public static native long gid(String groupnamelong p)
         throws Error;

    
Get the user name for a specified userid This function is available only if APR_HAS_USER is defined.

Parameters:
userid The userid
p The pool from which to allocate the string
Returns:
New string containing user name
 
      public static native String username(long useridlong p)
         throws Error;

    
Get the group name for a specified groupid This function is available only if APR_HAS_USER is defined.

Parameters:
groupid The groupid
p The pool from which to allocate the string
Returns:
New string containing group name
 
      public static native String groupname(long groupidlong p)
         throws Error;

    
Compare two user identifiers for equality. This function is available only if APR_HAS_USER is defined.

Parameters:
left One uid to test
right Another uid to test
Returns:
APR_SUCCESS if the apr_uid_t strutures identify the same user, APR_EMISMATCH if not, APR_BADARG if an apr_uid_t is invalid.
     public static native int uidcompare(long leftlong right);

    
Compare two group identifiers for equality. This function is available only if APR_HAS_USER is defined.

Parameters:
left One gid to test
right Another gid to test
Returns:
APR_SUCCESS if the apr_gid_t strutures identify the same group, APR_EMISMATCH if not, APR_BADARG if an apr_gid_t is invalid.
     public static native int gidcompare(long leftlong right);

    
Get the home directory for the named user This function is available only if APR_HAS_USER is defined.

Parameters:
username The named user
p The pool from which to allocate the string
Returns:
New string containing directory name
     public static native String homepath(String usernamelong p)
        throws Error;
New to GrepCode? Check out our FAQ X