34 | * Note: This might be replaced by utility method from commons-lang or guava someday 35 | * if one of those libraries is added as dependency. 36 | *
37 | * 38 | * @param array The array of strings 39 | * @param separator The separator 40 | * @return the resulting string 41 | */ 42 | public static String join(String[] array, String separator) { 43 | int len = array.length; 44 | if (len == 0) { 45 | return ""; 46 | } 47 | 48 | StringBuilder out = new StringBuilder(); 49 | out.append(array[0]); 50 | for (int i = 1; i < len; i++) { 51 | out.append(separator).append(array[i]); 52 | } 53 | return out.toString(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/docusign/esign/client/auth/HttpBasicAuth.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | package com.docusign.esign.client.auth; 4 | 5 | import com.docusign.esign.client.Pair; 6 | 7 | import java.util.Base64; 8 | import java.nio.charset.StandardCharsets; 9 | 10 | import java.util.Map; 11 | import java.util.List; 12 | 13 | 14 | 15 | 16 | /** 17 | * HttpBasicAuth class. 18 | * 19 | */ 20 | public class HttpBasicAuth implements Authentication { 21 | private String username; 22 | private String password; 23 | 24 | /** 25 | * getUsername method. 26 | * 27 | * @return String 28 | */ 29 | public String getUsername() { 30 | return username; 31 | } 32 | 33 | /** 34 | * setUsername method. 35 | * 36 | * @param username Sets username 37 | */ 38 | public void setUsername(String username) { 39 | this.username = username; 40 | } 41 | 42 | /** 43 | * getPassword method. 44 | * 45 | * @return String 46 | */ 47 | public String getPassword() { 48 | return password; 49 | } 50 | 51 | /** 52 | * setPassword method. 53 | * 54 | * @param password Sets password 55 | */ 56 | public void setPassword(String password) { 57 | this.password = password; 58 | } 59 | 60 | /** 61 | * applyToParams method. 62 | * 63 | * @param queryParams The query params 64 | * @param headerParams The header params 65 | */ 66 | @Override 67 | public void applyToParams(List
38 | * Note: If you make changes to the object mapper, remember to set it back via
39 | * setObjectMapper in order to trigger HTTP client rebuilding.
40 | *