Code example for PasswordAuthentication

0
        case SERVER:
            user = Main.pref.get("osm-server.username", null);
            password = Main.pref.get("osm-server.password", null);
            if (user == null)
                return null; 
            return new PasswordAuthentication(user, password == null ? new char[0] : password.toCharArray());
        case PROXY:
            throw new UnsupportedOperationException();
//            user = Main.pref.get(ProxyPreferencesPanel.PROXY_USER, null); 
//            password = Main.pref.get(ProxyPreferencesPanel.PROXY_PASS, null); 
//            if (user == null) 
//                return null; 
//            return new PasswordAuthentication(user, password == null ? new char[0] : password.toCharArray()); 
        } 
        return null; 
    } 
 
    /** 
     * @see CredentialsManager#store(RequestorType, PasswordAuthentication) 
     */ 
    public void store(RequestorType requestorType, PasswordAuthentication credentials) throws CredentialsManagerException {