if (bodySigning != null) {
bodySigningEnum = BodySigning.valueOf(bodySigning);
}
List<OAuth.Parameter> oauthParams = Lists.newArrayList();
UriBuilder target = new UriBuilder(Uri.parse(url));
String query = target.getQuery();
target.setQuery(null);
oauthParams.addAll(OAuth.decodeForm(query));
if (OAuth.isFormEncoded(contentType) && request.getPostBodyAsString() != null) {
oauthParams.addAll(OAuth.decodeForm(request.getPostBodyAsString()));
} else if (bodySigningEnum == BodySigning.legacy) {
oauthParams.add(new OAuth.Parameter(request.getPostBodyAsString(), ""));
} else if (bodySigningEnum == BodySigning.hash) {
oauthParams.add(
new OAuth.Parameter(OAuthConstants.OAUTH_BODY_HASH,
new String(Base64.encodeBase64(
DigestUtils.sha(request.getPostBodyAsString().getBytes())), "UTF-8")));
}
if (consumerKey != null) {
oauthParams.add(new OAuth.Parameter(OAuth.OAUTH_CONSUMER_KEY, consumerKey));
}
if (xOauthRequestor != null) {
oauthParams.add(new OAuth.Parameter("xoauth_requestor_id", xOauthRequestor));
}
OAuthConsumer consumer = new OAuthConsumer(null, consumerKey, consumerSecret, null);
OAuthAccessor accessor = new OAuthAccessor(consumer);
accessor.accessToken = accessToken;
accessor.tokenSecret = tokenSecret;
OAuthMessage message = accessor.newRequestMessage(method, target.toString(), oauthParams);
List<Map.Entry<String, String>> entryList = OAuthRequest.selectOAuthParams(message);
switch (paramLocationEnum) {
case AUTH_HEADER: