private static String getNetRC(OAuthTokenInfo accessTokenInfo) { StringBuilder sb = new StringBuilder(); sb.append("machine "); sb.append(accessTokenInfo.resourceHost()); sb.append(" login "); sb.append(accessTokenInfo.username()); sb.append(" password "); sb.append(accessTokenInfo.accessToken()); return sb.toString(); }
private static String getCookie(OAuthTokenInfo accessTokenInfo) { StringBuilder sb = new StringBuilder(); sb.append(accessTokenInfo.resourceHost()); sb.append("\tFALSE\t/\tTRUE\t"); sb.append(getExpiresAtSeconds(accessTokenInfo)); sb.append("\tgit-"); sb.append(accessTokenInfo.username()); sb.append('\t'); sb.append(accessTokenInfo.accessToken()); if (accessTokenInfo.providerId() != null) { sb.append('@').append(accessTokenInfo.providerId()); } return sb.toString(); }