public static String discoverProxyLocation() {

        String dir = null;

        if (getOS() == UNIX_OS) {
            dir = "/tmp/";
        } else {
            String tmpDir = System.getProperty("java.io.tmpdir");
            dir = (tmpDir == null) ? globus_dir : tmpDir;
        }

        String uid = System.getProperty("UID");

        if (uid != null) {
            return getLocation(dir, PROXY_NAME + uid);
        } else if (getOS() == UNIX_OS) {
            try {
                return getLocation(dir, PROXY_NAME + getUID());
            } catch (IOException e) {
            }
        }

        /* If all else fails use username */
        String suffix = System.getProperty("user.name");
        if (suffix != null) {
            suffix = suffix.toLowerCase();
        } else {
            suffix = "nousername";
        }

        return getLocation(dir, PROXY_NAME + "_" + suffix);
    }
public static String discoverProxyLocation ( ) { String dir = null ; if ( getOS ( ) == UNIX_OS ) { dir = "/tmp/" ; } else { String tmpDir = System . getProperty ( "java.io.tmpdir" ) ; dir = ( tmpDir == null ) ? globus_dir : tmpDir ; } String uid = System . getProperty ( "UID" ) ; if ( uid != null ) { return getLocation ( dir , PROXY_NAME + uid ) ; } else if ( getOS ( ) == UNIX_OS ) { try { return getLocation ( dir , PROXY_NAME + getUID ( ) ) ; } catch ( IOException e ) { } } String suffix = System . getProperty ( "user.name" ) ; if ( suffix != null ) { suffix = suffix . toLowerCase ( ) ; } else { suffix = "nousername" ; } return getLocation ( dir , PROXY_NAME + "_" + suffix ) ; }
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}