public void setProperties(Map<String,String> map) throws Exception { super.setProperties(map); this.password = map.get(PASSWORD); this.user = map.get(USER); if (this.password == null) { error("No .password property set on this plugin %s", map); } if (this.password == null) { error("No user property set on this plugin %s", map); } String authString = user + ":" + password; try { String encoded = Base64.encodeBase64(authString.getBytes("UTF-8")); this.authentication = PREFIX_BASIC_AUTH + encoded; } catch (UnsupportedEncodingException e) { // cannot happen, UTF-8 is always present } }
public void setProperties(Map<String,String> map) throws Exception { super.setProperties(map); this.password = map.get(PASSWORD); this.user = map.get(USER); if (this.password == null) { error("No .password property set on this plugin %s", map); } if (this.password == null) { error("No user property set on this plugin %s", map); } String authString = user + ":" + password; try { String encoded = Base64.encodeBase64(authString.getBytes("UTF-8")); this.authentication = PREFIX_BASIC_AUTH + encoded; } catch (UnsupportedEncodingException e) { // cannot happen, UTF-8 is always present } }
private void init(Map<String, String> map) { if (this.password == null) { error("No .password property set on this plugin %s", map); } if (this.user == null) { error("No user property set on this plugin %s", map); } String authString = user + ":" + password; try { String encoded = Base64.encodeBase64(authString.getBytes(UTF_8)); this.authentication = PREFIX_BASIC_AUTH + encoded; sha = SHA1.digest(password.getBytes()) .asHex(); } catch (Exception e) { // cannot happen, UTF-8 is always present } }
private void init(Map<String, String> map) { if (this.password == null) { error("No .password property set on this plugin %s", map); } if (this.user == null) { error("No user property set on this plugin %s", map); } String authString = user + ":" + password; try { String encoded = Base64.encodeBase64(authString.getBytes(UTF_8)); this.authentication = PREFIX_BASIC_AUTH + encoded; sha = SHA1.digest(password.getBytes()) .asHex(); } catch (Exception e) { // cannot happen, UTF-8 is always present } }