try { if (connectionSettings == null){ connectionSettings = new ConnectionSettings(); } String host = "localhost"; String passwort = ""; int xmlPort = 9851; host = getFirstAttrbuteByTagName(new String[] {"options", "remote", "host"}); passwort = getFirstAttrbuteByTagName(new String[] {"options", "remote", "passwort"}); xmlPort = Integer.parseInt(getFirstAttrbuteByTagName(new String[] { "options", "remote", "port"})); connectionSettings.setHost(host); if (passwort.length()==0){ connectionSettings.setOldPassword(""); } else{ connectionSettings.setOldMD5Password(passwort); } connectionSettings.setXmlPort(xmlPort); return connectionSettings; } catch (Exception e) { AppleJuiceDialog.rewriteProperties = true; if (logger.isEnabledFor(Level.ERROR)) { logger.error(PROPERTIES_ERROR_MESSAGE, e); } AppleJuiceDialog.closeWithErrormessage(PROPERTIES_ERROR, false); return null; } }
try { if (connectionSettings == null) { connectionSettings = new ConnectionSettings(); } String host = "localhost"; String passwort = ""; int xmlPort = 9851; host = propertyHandler.get("options_remote_host"); passwort = propertyHandler.get("options_remote_passwort"); xmlPort = Integer.parseInt(propertyHandler .get("options_remote_port")); connectionSettings.setHost(host); if (passwort.length() == 0) { connectionSettings.setOldPassword(""); } else { connectionSettings.setOldMD5Password(passwort); } connectionSettings.setXmlPort(xmlPort); return connectionSettings; } catch (Exception e) { AppleJuiceDialog.rewriteProperties = true; if (logger.isEnabledFor(Level.ERROR)) { logger.error(PROPERTIES_ERROR_MESSAGE, e); } AppleJuiceDialog.closeWithErrormessage(PROPERTIES_ERROR, false); return null; } }
    public ConnectionSettings getRemoteSettings() {        try {            if (connectionSettings == null){                connectionSettings = new ConnectionSettings();            }            String host = "localhost";            String passwort = "";            int xmlPort = 9851;            host = getFirstAttrbuteByTagName(new String[] {"options", "remote",                                             "host"});            passwort = getFirstAttrbuteByTagName(new String[] {"options",                                                 "remote", "passwort"});            xmlPort = Integer.parseInt(getFirstAttrbuteByTagName(new String[] {                "options", "remote",                "port"}));            connectionSettings.setHost(host);            if (passwort.length()==0){                connectionSettings.setOldPassword("");            }            else{                connectionSettings.setOldMD5Password(passwort);            }            connectionSettings.setXmlPort(xmlPort);            return connectionSettings;        }        catch (Exception e) {            AppleJuiceDialog.rewriteProperties = true;            if (logger.isEnabledFor(Level.ERROR)) {                logger.error(PROPERTIES_ERROR_MESSAGE, e);            }            AppleJuiceDialog.closeWithErrormessage(PROPERTIES_ERROR, false);            return null;        }    }