Code example for PasswordAuthentication

Methods: getPasswordgetUserName

0
    public void store(RequestorType requestorType, PasswordAuthentication credentials) throws CredentialsManagerException {
        if (requestorType == null)
            return; 
        switch(requestorType) {
        case SERVER:
            Main.pref.put("osm-server.username", credentials.getUserName());
            if (credentials.getPassword() == null) {
                Main.pref.put("osm-server.password", null); 
            } else { 
                Main.pref.put("osm-server.password", String.valueOf(credentials.getPassword()));
            } 
            break; 
        case PROXY:
            throw new UnsupportedOperationException();
//            Main.pref.put(ProxyPreferencesPanel.PROXY_USER, credentials.getUserName()); 
//            if (credentials.getPassword() == null) { 
//                Main.pref.put(ProxyPreferencesPanel.PROXY_PASS, null); 
//            } else { 
//                Main.pref.put(ProxyPreferencesPanel.PROXY_PASS, String.valueOf(credentials.getPassword())); 
//            } 
Contextual code suggestions in your IDE  Get Codota for Java