Examples of MethodOverride


Examples of com.google.api.client.googleapis.MethodOverride

   */
  @Override
  protected HttpRequest buildHttpRequest(HttpMethod method, GenericUrl url, Object body)
      throws IOException {
    HttpRequest httpRequest = super.buildHttpRequest(method, url, body);
    new MethodOverride().intercept(httpRequest);
    // custom methods may use POST with no content but require a Content-Length header
    if (body == null && method.equals(HttpMethod.POST)) {
      httpRequest.setContent(new EmptyContent());
    }
    return httpRequest;
View Full Code Here

Examples of com.google.api.client.googleapis.MethodOverride

    HttpResponse response;
    // Upload the media content in chunks.
    while (true) {
      currentRequest = requestFactory.buildPutRequest(uploadUrl, null);
      new MethodOverride().intercept(currentRequest); // needed for PUT
      setContentAndHeadersOnCurrentRequest(bytesUploaded);
      if (backOffPolicyEnabled) {
        // Set MediaExponentialBackOffPolicy as the BackOffPolicy of the HTTP Request which will
        // callback to this instance if there is a server error.
        currentRequest.setBackOffPolicy(new MediaUploadExponentialBackOffPolicy(this));
View Full Code Here

Examples of com.google.api.client.googleapis.MethodOverride

   * support PUT.
   *
   * @param request HTTP request
   */
  private void addMethodOverride(HttpRequest request) {
    new MethodOverride().intercept(request);
  }
View Full Code Here

Examples of com.google.api.client.googleapis.MethodOverride

    Preconditions.checkNotNull(currentRequest, "The current request should not be null");

    // TODO(rmistry): Handle timeouts here similar to how server errors are handled.
    // Query the current status of the upload by issuing an empty POST request on the upload URI.
    HttpRequest request = requestFactory.buildPutRequest(currentRequest.getUrl(), null);
    new MethodOverride().intercept(request); // needed for PUT

    request.getHeaders().setContentRange("bytes */" + getMediaContentLength());
    request.setThrowExceptionOnExecuteError(false);
    request.setRetryOnExecuteIOException(true);
    HttpResponse response = request.execute();
View Full Code Here

Examples of com.google.api.client.googleapis.MethodOverride

   * @param request current request
   * @return HTTP response
   */
  private HttpResponse executeCurrentRequest(HttpRequest request) throws IOException {
    // method override for non-POST verbs
    new MethodOverride().intercept(request);
    // don't throw an exception so we can let a custom Google exception be thrown
    request.setThrowExceptionOnExecuteError(false);
    // execute the request
    HttpResponse response = request.execute();
    return response;
View Full Code Here

Examples of org.springframework.beans.factory.support.MethodOverride

      // Compare reference with method-override beans
      if (!bd.getMethodOverrides().isEmpty()) {
        Iterator methodsOverrides = bd.getMethodOverrides()
            .getOverrides().iterator();
        while (methodsOverrides.hasNext()) {
          MethodOverride methodOverride = (MethodOverride)
              methodsOverrides.next();
          if (methodOverride instanceof LookupOverride) {
            String name = ((LookupOverride) methodOverride)
                .getBeanName();
            if (pattern.matcher(name).matches()) {
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.