void (Element element) { setHost(element.getAttributeValue(HOST)); setLiteralPort(element.getAttributeValue(PORT)); setSerializedUserName(element.getAttributeValue(USERNAME)); setSerializedPassword(element.getAttributeValue(PASSWORD)); setPrivateKeyFile(StringUtil.nullize(element.getAttributeValue(PRIVATE_KEY_FILE))); setSerializedPassphrase(element.getAttributeValue(PASSPHRASE)); // true by default for all IDEs except DataGrip due to historical reasons setOpenSshConfigUsageForced(Boolean.parseBoolean(StringUtil.defaultIfEmpty(element.getAttributeValue(USE_OPENSSH_CONFIG), String.valueOf(!PlatformUtils.isDataGrip())))); boolean useKeyPair = Boolean.parseBoolean(element.getAttributeValue(USE_KEY_PAIR)); boolean useAuthAgent = Boolean.parseBoolean(element.getAttributeValue(USE_AUTH_AGENT)); if (useKeyPair) { myAuthType = AuthType.KEY_PAIR; } else if (useAuthAgent) { // the old `USE_AUTH_AGENT` attribute is used to avoid settings migration myAuthType = AuthType.OPEN_SSH; } else { myAuthType = AuthType.PASSWORD; } // try to load credentials from PasswordSafe final CredentialAttributes attributes = createAttributes(false); final Credentials credentials = PasswordSafe.getInstance().get(attributes); if (credentials != null) { final boolean memoryOnly = PasswordSafe.getInstance().isPasswordStoredOnlyInMemory(attributes, credentials); if (myAuthType == AuthType.KEY_PAIR) { setPassword(null); setStorePassword(false); setPassphrase(credentials.getPasswordAsString()); setStorePassphrase(!memoryOnly); } else if (myAuthType == AuthType.PASSWORD) { setPassword(credentials.getPasswordAsString()); setStorePassword(!memoryOnly); setPassphrase(null); setStorePassphrase(false); } else { setOpenSshConfigUsageForced(true); setPassword(null); setStorePassword(false); setPassphrase(null); setStorePassphrase(false); } } boolean isAnonymous = Boolean.parseBoolean(element.getAttributeValue(ANONYMOUS)); if (isAnonymous) { setSerializedUserName("anonymous"); setSerializedPassword("user@example.com"); } }