当前位置: 首页>>代码示例>>Java>>正文


Java OAuthException.printStackTrace方法代码示例

本文整理汇总了Java中oauth.signpost.exception.OAuthException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java OAuthException.printStackTrace方法的具体用法?Java OAuthException.printStackTrace怎么用?Java OAuthException.printStackTrace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在oauth.signpost.exception.OAuthException的用法示例。


在下文中一共展示了OAuthException.printStackTrace方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAccessTokenSet

import oauth.signpost.exception.OAuthException; //导入方法依赖的package包/类
/**
 * Get access token-secret pair
 * 
 * @param	verifier OAuth verifier, which was got after authorization 
 * @return	Access token-secret pair
 * */
public HashMap<String, String> getAccessTokenSet(String verifier) {
	try {
           mOAuthProvider.retrieveAccessToken(mOAuthConsumer, verifier);
       }
       catch (OAuthException e) {
           e.printStackTrace();
       }
	
	return setTokenWithSecret(mOAuthConsumer.getToken(), mOAuthConsumer.getTokenSecret()); 
}
 
开发者ID:upwork,项目名称:java-upwork,代码行数:17,代码来源:OAuthClient.java

示例2: _getAuthorizationUrl

import oauth.signpost.exception.OAuthException; //导入方法依赖的package包/类
/**
 * Get authorization URL, use provided callback URL
 * 
    * @param   oauthCallback URL, i.e. oauth_callback
 * @return	URL for authorizing application
 * */
private String _getAuthorizationUrl(String oauthCallback) {
	String url = null;
       
	try {
           url = mOAuthProvider.retrieveRequestToken(mOAuthConsumer, oauthCallback);
       }
       catch (OAuthException e) {
           e.printStackTrace();
       }
	
	return url;
}
 
开发者ID:upwork,项目名称:java-upwork,代码行数:19,代码来源:OAuthClient.java

示例3: getOAuthURL

import oauth.signpost.exception.OAuthException; //导入方法依赖的package包/类
public String getOAuthURL() {
    try {
        String auth = mOAuthProvider.retrieveRequestToken(mOAuthConsumer, "oauth://discogs");
        return auth;
    } catch (OAuthException e) {
        e.printStackTrace();
    }
    return null;
}
 
开发者ID:jvanhie,项目名称:discogsscrobbler,代码行数:10,代码来源:Discogs.java

示例4: setAccessToken

import oauth.signpost.exception.OAuthException; //导入方法依赖的package包/类
public void setAccessToken(String verifier) {
    try {
        if(verifier!=null) {
            mOAuthProvider.retrieveAccessToken(mOAuthConsumer, verifier);
            setSession(mOAuthConsumer.getToken(), mOAuthConsumer.getTokenSecret());
        }

    } catch (OAuthException e) {
        e.printStackTrace();
    }
}
 
开发者ID:jvanhie,项目名称:discogsscrobbler,代码行数:12,代码来源:Discogs.java

示例5: sendPostRequest

import oauth.signpost.exception.OAuthException; //导入方法依赖的package包/类
/**
 * Send signed POST OAuth request
 * 
 * @param	url Relative URL
 * @param	type Type of HTTP request (HTTP method)
 * @param	params Hash of parameters
 * @throws	JSONException If JSON object is invalid or request was abnormal
 * @return	{@link JSONObject} JSON Object that contains data from response
 * */
private JSONObject sendPostRequest(String url, Integer type, HashMap<String, String> params) throws JSONException {
	String fullUrl = getFullUrl(url);
	HttpPost request = new HttpPost(fullUrl);
	
	switch(type) {
	case METHOD_PUT:
	case METHOD_DELETE:
		// assign overload value
       	String oValue;
       	if (type == METHOD_PUT) {
       		oValue = "put";
       	} else {
       		oValue = "delete";
       	}
       	params.put(OVERLOAD_PARAM, oValue);
	case METHOD_POST:
		break;
	default:
           throw new RuntimeException("Wrong http method requested");
	}
	
	// doing post request using json to avoid issue with urlencoded symbols
	JSONObject json = new JSONObject();
	
       for (Map.Entry<String, String> entry : params.entrySet()) {
           json.put(entry.getKey(), entry.getValue());
       }
	
	request.setHeader("Content-Type", "application/json");
	try {
		request.setEntity(new StringEntity(json.toString()));
	} catch (UnsupportedEncodingException e1) {
		// TODO Auto-generated catch block
		e1.printStackTrace();
	}
	
       // sign request
	try {
		mOAuthConsumer.sign(request);
	}
	catch (OAuthException e) {
           e.printStackTrace();
       }
	
       return UpworkRestClient.getJSONObject(request, type, params);
   }
 
开发者ID:upwork,项目名称:java-upwork,代码行数:56,代码来源:OAuthClient.java

示例6: sendPostRequest

import oauth.signpost.exception.OAuthException; //导入方法依赖的package包/类
/**
 * Send signed POST OAuth request
 * 
 * @param	url Relative URL
 * @param	type Type of HTTP request (HTTP method)
 * @param	params Hash of parameters
 * @throws	JSONException If JSON object is invalid or request was abnormal
 * @return	{@link JSONObject} JSON Object that contains data from response
 * */
private JSONObject sendPostRequest(String url, Integer type, HashMap<String, String> params) throws JSONException {
	String fullUrl = getFullUrl(url);
	HttpPost request = new HttpPost(fullUrl);
	
	switch(type) {
	case METHOD_PUT:
	case METHOD_DELETE:
		// assign overload value
       	String oValue;
       	if (type == METHOD_PUT) {
       		oValue = "put";
       	} else {
       		oValue = "delete";
       	}
       	params.put(OVERLOAD_PARAM, oValue);
	case METHOD_POST:
		break;
	default:
           throw new RuntimeException("Wrong http method requested");
	}
	
	// doing post request using json to avoid issue with urlencoded symbols
	JSONObject json = new JSONObject();
	
       for (Map.Entry<String, String> entry : params.entrySet()) {
           json.put(entry.getKey(), entry.getValue());
       }
	
	request.setHeader("Content-Type", "application/json");
	try {
		request.setEntity(new StringEntity(json.toString()));
	} catch (UnsupportedEncodingException e1) {
		// TODO Auto-generated catch block
		e1.printStackTrace();
	}
	
       // sign request
	try {
		mOAuthConsumer.sign(request);
	}
	catch (OAuthException e) {
           e.printStackTrace();
       }
	
       return oDeskRestClient.getJSONObject(request, type, params);
   }
 
开发者ID:odesk,项目名称:java-odesk,代码行数:56,代码来源:OAuthClient.java


注:本文中的oauth.signpost.exception.OAuthException.printStackTrace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。