Package org.apache.http.client.methods

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


            else {
              throw new FilesException("Unexpected Server Response",response.getResponseHeaders(), response.getStatusLine());
            }
          } finally {
            if (method != null) {
              method.abort();
            }
          }
        }
        else
        {
View Full Code Here


                 FilesClient.sanitizeForURI(metadata.get(key)));
           }
          HttpResponse resp = client.execute(method);
          response = new FilesResponse(resp);
          if (response.getStatusCode() == HttpStatus.SC_UNAUTHORIZED) {
            method.abort();
            if(login()) {
              method = new HttpPost(postUrl);
                 method.getParams().setIntParameter("http.socket.timeout", connectionTimeOut);
                 method.setHeader(FilesConstants.X_AUTH_TOKEN, authToken);
                 if (!(metadata == null || metadata.isEmpty())) {
View Full Code Here

          }
         
          return true;
        } finally {
          if (method != null)
            method.abort();
        }
       
    }
   
    private String makeURI(String base, List<NameValuePair> parameters) {
View Full Code Here

        };

        try {
            httpClient.execute(post, handler);
        } catch(IOException ex) {
            post.abort();
            throw ex;
        } finally {
            post.releaseConnection();
        }
View Full Code Here

          return result;
        }
      }
    } catch (Exception ex) {
      log.error("Error while invoking remoting method.", ex);
      post.abort();
    } finally {
      if (resultBuffer != null) {
        resultBuffer.free();
        resultBuffer = null;
      }
View Full Code Here

      } else {
        resp.sendError(HttpStatus.SC_BAD_REQUEST);
      }
    } catch (Exception ex) {
      log.error("", ex);
      post.abort();
    }
  }
}
View Full Code Here

                break;
            }
        }

        r.close();
        post.abort();  

        ObjectNode result = fact.objectNode();
        result.put("token",authToken);
        result.put("url",storageUrl);
        return result;
View Full Code Here

           
      inputStream_ = new ByteArrayInputStream(baos.toByteArray());
    } catch (IOException ioe) {
      // Abort method so the connection gets released back to the connection manager
      if (null != post) {
        post.abort();
      }
      throw new TTransportException(ioe);
    } finally {
      if (null != is) {
        // Close the entity's input stream, this will release the underlying connection
View Full Code Here

        };

        try {
            httpClient.execute(post, handler);
        } catch(IOException ex) {
            post.abort();
            throw ex;
        } finally {
            post.releaseConnection();
        }
View Full Code Here

           
      inputStream_ = new ByteArrayInputStream(baos.toByteArray());
    } catch (IOException ioe) {
      // Abort method so the connection gets released back to the connection manager
      if (null != post) {
        post.abort();
      }
      throw new TTransportException(ioe);
    } finally {
      if (null != is) {
        // Close the entity's input stream, this will release the underlying connection
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.