类com.google.api.client.http.UrlEncodedParser源码实例Demo

下面列出了怎么用com.google.api.client.http.UrlEncodedParser的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: mirror   文件: ImplicitResponseUrl.java

private ImplicitResponseUrl(String scheme, String host, int port, String path, String fragment,
                            String query, String userInfo) {
    setScheme(scheme);
    setHost(host);
    setPort(port);
    setPathParts(toPathParts(path));
    setFragment(fragment != null ? CharEscapers.decodeUri(fragment) : null);
    if (fragment != null) {
        UrlEncodedParser.parse(fragment, this);
    }
    // no need for query parameters
    setUserInfo(userInfo != null ? CharEscapers.decodeUri(userInfo) : null);
}
 

/**
 * Executes the HTTP request for a temporary or long-lived token.
 *
 * @return OAuth credentials response object
 */
public final OAuthCredentialsResponse execute() throws IOException {
  HttpRequestFactory requestFactory = transport.createRequestFactory();
  HttpRequest request =
      requestFactory.buildRequest(usePost ? HttpMethods.POST : HttpMethods.GET, this, null);
  createParameters().intercept(request);
  HttpResponse response = request.execute();
  response.setContentLoggingLimit(0);
  OAuthCredentialsResponse oauthResponse = new OAuthCredentialsResponse();
  UrlEncodedParser.parse(response.parseAsString(), oauthResponse);
  return oauthResponse;
}
 

private ImplicitResponseUrl(String scheme, String host, int port, String path, String fragment,
        String query, String userInfo) {
    setScheme(scheme);
    setHost(host);
    setPort(port);
    setPathParts(toPathParts(path));
    setFragment(fragment != null ? CharEscapers.decodeUri(fragment) : null);
    if (fragment != null) {
        UrlEncodedParser.parse(fragment, this);
    }
    // no need for query parameters
    setUserInfo(userInfo != null ? CharEscapers.decodeUri(userInfo) : null);
}
 
 类方法
 同包方法