/** * Append the user credentials. * <p> * If anything was added, it will be '@' terminated. * * @param buffer the string buffer to modify. * @param addPassword flag if password should be added or replaced with placeholder (false). */ protected void appendCredentials(final StringBuilder buffer, final boolean addPassword) { if (userName != null && userName.length() != 0) { UriParser.appendEncoded(buffer, userName, USERNAME_RESERVED); if (password != null && password.length() != 0) { buffer.append(':'); if (addPassword) { UriParser.appendEncoded(buffer, password, PASSWORD_RESERVED); } else { buffer.append("***"); } } buffer.append('@'); } } }
/** * Append the user credentials. * <p> * If anything was added, it will be '@' terminated. * * @param buffer the string buffer to modify. * @param addPassword flag if password should be added or replaced with placeholder (false). */ protected void appendCredentials(final StringBuilder buffer, final boolean addPassword) { if (userName != null && userName.length() != 0) { UriParser.appendEncoded(buffer, userName, USERNAME_RESERVED); if (password != null && password.length() != 0) { buffer.append(':'); if (addPassword) { UriParser.appendEncoded(buffer, password, PASSWORD_RESERVED); } else { buffer.append("***"); } } buffer.append('@'); } } }
/** * Append the user credentials. * <p> * If anything was added, it will be '@' terminated. * * @param buffer the string buffer to modify. * @param addPassword flag if password should be added or replaced with placeholder (false). */ protected void appendCredentials(final StringBuilder buffer, final boolean addPassword) { if (userName != null && userName.length() != 0) { UriParser.appendEncoded(buffer, userName, USERNAME_RESERVED); if (password != null && password.length() != 0) { buffer.append(':'); if (addPassword) { UriParser.appendEncoded(buffer, password, PASSWORD_RESERVED); } else { buffer.append("***"); } } buffer.append('@'); } } }