Examples of GenericUrl


Examples of com.google.api.client.http.GenericUrl

    if (getClient().isBaseUrlUsed()) {
      baseUrl = getClient().getBaseUrl();
    } else {
      baseUrl = getClient().getRootUrl() + getClient().getServicePath();
    }
    return new GenericUrl(UriTemplate.expand(baseUrl, uriTemplate, this, true));
  }
View Full Code Here

Examples of com.google.api.client.http.GenericUrl

       * Internal constructor for media upload.  Use the convenience method instead.
       */
      Insert(String tableId,
          com.google.api.client.http.AbstractInputStreamContent mediaContent) {
        super(Fusiontables.this, HttpMethod.POST,
            "/upload" + new GenericUrl(getBaseUrl()).getRawPath() + REST_PATH, null);
        this.tableId = Preconditions.checkNotNull(tableId, "Required parameter tableId must be specified.");
        this.uploader =
          new com.google.api.client.googleapis.media.MediaHttpUploader(mediaContent,
            getRequestFactory().getTransport(), getRequestFactory().getInitializer());
        this.uploader.setInitiationMethod(HttpMethod.POST);
View Full Code Here

Examples of com.google.api.client.http.GenericUrl

  private HttpResponse getFakeResponse(final int statusCode, final String partContent,
      List<String> headerNames, List<String> headerValues)
      throws IOException {
    HttpRequest request = new FakeResponseHttpTransport(
        statusCode, partContent, headerNames, headerValues).createRequestFactory()
        .buildPostRequest(new GenericUrl("http://google.com/"), null);
    request.setLoggingEnabled(false);
    request.setThrowExceptionOnExecuteError(false);
    return request.execute();
  }
View Full Code Here

Examples of com.google.api.client.http.GenericUrl

    JsonHttpContent content = new JsonHttpContent(jsonFactory, data);
    content.setMediaType(new HttpMediaType(mimeType));
    HttpRequest httpRequest;
    try {
      httpRequest =
          transport.createRequestFactory().buildPostRequest(new GenericUrl(rpcServerUrl), content);
      httpRequest.getHeaders().setAccept(accept);
      return httpRequest;
    } catch (IOException e) {
      throw new IllegalStateException(e);
    }
View Full Code Here

Examples of com.google.api.client.http.GenericUrl

   * @param clientId client identifier issued to the client during the registration process
   * @param clientSecret client secret
   */
  public GoogleRefreshTokenRequest(HttpTransport transport, JsonFactory jsonFactory,
      String refreshToken, String clientId, String clientSecret) {
    super(transport, jsonFactory, new GenericUrl(GoogleOAuthConstants.TOKEN_SERVER_URL),
        refreshToken);
    setClientAuthentication(new ClientParametersAuthentication(clientId, clientSecret));
  }
View Full Code Here

Examples of com.google.api.client.http.GenericUrl

   * @throws ClientLoginResponseException if the authentication response has an error code, such as
   *         for a CAPTCHA challenge.
   * @throws IOException some other kind of I/O exception
   */
  public Response authenticate() throws ClientLoginResponseException, IOException {
    GenericUrl url = serverUrl.clone();
    url.appendRawPath("/accounts/ClientLogin");
    HttpRequest request =
        transport.createRequestFactory().buildPostRequest(url, new UrlEncodedContent(this));
    request.setParser(AuthKeyValueParser.INSTANCE);
    request.setContentLoggingLimit(0);
    request.setThrowExceptionOnExecuteError(false);
View Full Code Here

Examples of com.google.api.client.http.GenericUrl

    public Builder(HttpTransport transport, JsonFactory jsonFactory, String clientId,
        String clientSecret, Iterable<String> scopes) {
      super(BearerToken.authorizationHeaderAccessMethod(),
          transport,
          jsonFactory,
          new GenericUrl(GoogleOAuthConstants.TOKEN_SERVER_URL),
          new ClientParametersAuthentication(clientId, clientSecret),
          clientId,
          GoogleOAuthConstants.AUTHORIZATION_SERVER_URL);
      setScopes(Preconditions.checkNotNull(scopes));
    }
View Full Code Here

Examples of com.google.api.client.http.GenericUrl

    public Builder(HttpTransport transport, JsonFactory jsonFactory,
        GoogleClientSecrets clientSecrets, Iterable<String> scopes) {
      super(BearerToken.authorizationHeaderAccessMethod(),
          transport,
          jsonFactory,
          new GenericUrl(GoogleOAuthConstants.TOKEN_SERVER_URL),
          new ClientParametersAuthentication(clientSecrets.getDetails().getClientId(),
              clientSecrets.getDetails().getClientSecret()),
          clientSecrets.getDetails().getClientId(),
          GoogleOAuthConstants.AUTHORIZATION_SERVER_URL);
      setScopes(Preconditions.checkNotNull(scopes));
View Full Code Here

Examples of com.google.api.client.http.GenericUrl

      JsonFactory jsonFactory,
      String clientId,
      String clientSecret,
      String code,
      String redirectUri) {
    super(transport, jsonFactory, new GenericUrl(GoogleOAuthConstants.TOKEN_SERVER_URL), code);
    setClientAuthentication(new ClientParametersAuthentication(clientId, clientSecret));
    setRedirectUri(redirectUri);
  }
View Full Code Here

Examples of com.google.api.client.http.GenericUrl

   */
  @SuppressWarnings("deprecation")
  public BatchRequest batch(HttpRequestInitializer httpRequestInitializer) {
    BatchRequest batch =
        new BatchRequest(getRequestFactory().getTransport(), httpRequestInitializer);
    GenericUrl baseUrl;
    if (isBaseUrlUsed()) {
      baseUrl = new GenericUrl(getBaseUrl());
      baseUrl.setPathParts(Arrays.asList("", "batch"));
    } else {
      baseUrl = new GenericUrl(getRootUrl() + "batch");
    }
    batch.setBatchUrl(baseUrl);
    return batch;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.