Package com.google.api.client.http

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


          "bytes=" + bytesDownloaded + "-" + (bytesDownloaded + chunkSize - 1));

      if (backOffPolicyEnabled) {
        // Set ExponentialBackOffPolicy as the BackOffPolicy of the HTTP Request which will
        // retry the same request again if there is a server error.
        request.setBackOffPolicy(new ExponentialBackOffPolicy());
      }

      HttpResponse response = request.execute();
      AbstractInputStreamContent.copy(response.getContent(), outputStream);
View Full Code Here


      }
      request.getHeaders().setRange(rangeHeader.toString());
    }
    // use exponential backoff on server error
    if (backOffPolicyEnabled) {
      request.setBackOffPolicy(new ExponentialBackOffPolicy());
    }
    // execute the request and copy into the output stream
    HttpResponse response = request.execute();
    try {
      IOUtils.copy(response.getContent(), outputStream);
View Full Code Here

   */
  private HttpResponse executeCurrentRequestWithBackOffAndGZip(HttpRequest request)
      throws IOException {
    // use exponential backoff on server error
    if (backOffPolicyEnabled) {
      request.setBackOffPolicy(new ExponentialBackOffPolicy());
    }
    // enable GZip encoding if necessary
    if (!disableGZipContent && !(request.getContent() instanceof EmptyContent)) {
      request.setEncoding(new GZipEncoding());
    }
View Full Code Here

TOP

Related Classes of com.google.api.client.http.ExponentialBackOffPolicy

Copyright © 2018 www.massapicom. 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.