Package org.globus.util

# Class ConfigUtil

java.lang.Object
org.globus.util.ConfigUtil

public class ConfigUtil extends Object

## Field Summary

Fields
Modifier and Type
Field
Description
`static String`
`globus_dir`
`static final int`
`MAC_OS`
`static final int`
`OTHER_OS`
`static final int`
`UNDEFINED_OS`
`static final int`
`UNIX_OS`
`static final int`
`WINDOWS_OS`

## Constructor Summary

Constructors
Constructor
Description
`ConfigUtil()`

## Method Summary

Modifier and Type
Method
Description
`static String`
`discoverCertDirLocation()`
Discovers location of CA certificates directory.
`static String`
`discoverPKCS11LibName()`
Returns default PKCS11 library name
`static String`
`discoverProxyLocation()`
Tries to discover user proxy location.
`static String`
`discoverUserCertLocation()`
Returns default location of user cert file
`static String`
`discoverUserKeyLocation()`
Returns default location of user key file
`static int`
`getOS()`
`static String`
`getUID()`
Returns the user id.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### UNDEFINED_OS

public static final int UNDEFINED_OS

See Also:
  - Constant Field Values

### WINDOWS_OS

public static final int WINDOWS_OS

See Also:
  - Constant Field Values

### UNIX_OS

public static final int UNIX_OS

See Also:
  - Constant Field Values

### MAC_OS

public static final int MAC_OS

See Also:
  - Constant Field Values

### OTHER_OS

public static final int OTHER_OS

See Also:
  - Constant Field Values

### globus_dir

public static String globus_dir

## Constructor Details

### ConfigUtil

public ConfigUtil()

## Method Details

### discoverPKCS11LibName

public static String discoverPKCS11LibName()
Returns default PKCS11 library name

### discoverUserCertLocation

public static String discoverUserCertLocation()
Returns default location of user cert file

### discoverUserKeyLocation

public static String discoverUserKeyLocation()
Returns default location of user key file

### discoverProxyLocation

public static String discoverProxyLocation()
Tries to discover user proxy location. If a UID system property is set, and running on a Unix machine it returns /tmp/x509up_u${UID}. If any other machine then Unix, it returns ${tempdir}/x509up_u${UID}, where tempdir is a platform-specific temporary directory as indicated by the java.io.tmpdir system property. If a UID system property is not set, the username will be used instead of the UID. That is, it returns ${tempdir}/x509up_u_${username}

### getUID

public static String getUID() throws IOException
Returns the user id. The user id is obtained by executing 'id -u' external program.
Note: Under some circumstances, this function executes an external program; thus, its behavior is influenced by environment variables such as the caller's PATH and the environment variables that control dynamic loading. Care should be used if calling this function from a program that will be run as a Unix setuid program, or in any other manner in which the owner of the Unix process does not completely control its runtime environment.

Returns:
  the user id
Throws:
  `IOException` - if unable to determine the user id.

### discoverCertDirLocation

public static String discoverCertDirLocation()
Discovers location of CA certificates directory. First the ${user.home}/.globus/certificates directory is checked. If the directory does not exist, and on a Unix machine, the /etc/grid-security/certificates directory is checked next. If that directory does not exist and GLOBUS_LOCATION system property is set then the ${GLOBUS_LOCATION}/share/certificates directory is checked. Otherwise, null is returned. This indicates that the certificates directory could not be found.

### getOS

public static int getOS()