Package org.apache.http.client.methods

Examples of org.apache.http.client.methods.HttpPut.abort()


      // We presume that the data is utf-8, since that's what the API uses throughout.
      return responseString;
    }
    finally
    {
      method.abort();
    }
  }

  /** Perform an json API POST operation.
  *@param apiURL is the operation.
View Full Code Here


            firePutCompleted( resource, source );
        }
        finally
        {
            putMethod.abort();
        }
    }

    protected void mkdirs( String dirname )
        throws HttpException, IOException
View Full Code Here

         put.setEntity(new ByteArrayEntity(marshall(contentType, entry), ContentType.create(contentType)));
         httpClient.execute(httpHost, put);
      } catch (Exception e) {
         throw new PersistenceException(e);
      } finally {
         put.abort();
      }
   }

   @Override
   public void clear() {
View Full Code Here

            // notify user that file has been uploaded
            notification.finished();
        } catch( Exception e ) {
            Log.e( TAG, "exception: " + sUrl, e );
            // file upload failed so abort post and close connection
            p.abort();
            client.getConnectionManager().shutdown();

            // get user preferences and number of retries for failed upload
            SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences( context );
            int maxRetries = Integer.valueOf( prefs.getString( "retries", "" ).substring( 1 ) );
View Full Code Here

      // We presume that the data is utf-8, since that's what the API uses throughout.
      return responseString;
    }
    finally
    {
      method.abort();
    }
  }

  /** Perform an json API POST operation.
  *@param apiURL is the operation.
View Full Code Here

            firePutCompleted( resource, source );
        }
        finally
        {
            putMethod.abort();
        }
    }

    protected String calculateRelocatedUrl( HttpResponse response )
    {
View Full Code Here

         
          try {
            FilesResponse response = new FilesResponse(client.execute(method));     
           
                 if (response.getStatusCode() == HttpStatus.SC_UNAUTHORIZED) {
                   method.abort();
                if(login()) {
                     method = new HttpPut(getStorageURL()+"/"+sanitizeForURI(name));
                    method.getParams().setIntParameter("http.socket.timeout", connectionTimeOut);
                    method.setHeader(FilesConstants.X_AUTH_TOKEN, authToken);
                  response = new FilesResponse(client.execute(method));
View Full Code Here

            else {
              throw new FilesException("Unexpected Response", response.getResponseHeaders(), response.getStatusLine());
            }
          }
          finally {
            method.abort();
          }
        }
        else
        {
          throw new FilesInvalidNameException(name);
View Full Code Here

            method.getParams().setIntParameter("http.socket.timeout", connectionTimeOut);
            method.setHeader(FilesConstants.X_AUTH_TOKEN, authToken);
            FilesResponse response = new FilesResponse(client.execute(method));

            if (response.getStatusCode() == HttpStatus.SC_UNAUTHORIZED) {
              method.abort();
              if(login()) {
                method = new HttpPut(getCdnManagementURL()+"/"+sanitizeForURI(name));
                method.getParams().setIntParameter("http.socket.timeout", connectionTimeOut);
                method.setHeader(FilesConstants.X_AUTH_TOKEN, authToken);
                response = new FilesResponse(client.execute(method));
View Full Code Here

            else {
              throw new FilesException("Unexpected Server Response",response.getResponseHeaders(), response.getStatusLine());
            }
          }
          finally  {
            method.abort();
          }
        }
        else
        {
          throw new FilesInvalidNameException(name);
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.