Package org.apache.http.client.methods

Examples of org.apache.http.client.methods.HttpDelete.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 PUT operation.
  *@param apiURL is the operation.
View Full Code Here


         HttpResponse response = httpClient.execute(httpHost, del);
         EntityUtils.consume(response.getEntity());
      } catch (Exception e) {
         throw new PersistenceException(e);
      } finally {
         del.abort();
      }
   }

   @Override
   public boolean delete(Object key) {
View Full Code Here

         EntityUtils.consume(response.getEntity());
         return isSuccessful(response.getStatusLine().getStatusCode());
      } catch (Exception e) {
         throw new PersistenceException(e);
      } finally {
         del.abort();
      }
   }

   @Override
   public MarshalledEntry load(Object key) {
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 PUT operation.
  *@param apiURL is the operation.
View Full Code Here

                authResponseData.append(reader.readLine());
            } catch (RuntimeException ex) {
                // In case of an unexpected exception you may want to abort
                // the HTTP request in order to shut down the underlying
                // connection and release it back to the connection manager.
                httpdel.abort();
                LOGGER.throwing(AuthServlet.class.getName(), "doLogout", ex);
                throw ex;
            } finally {
                // Closing the input stream will trigger connection release
                if (reader != null) {
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 HttpDelete(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

                logger.debug ("Container is not empty, can not delete a none empty container !");
                throw new FilesContainerNotEmptyException("You can't delete an non-empty container", response.getResponseHeaders(), response.getStatusLine());
              }
          }
          finally {
            method.abort();
          }
        }
        else
        {
               throw new FilesInvalidNameException(name);
View Full Code Here

      }
   
      FilesResponse response = new FilesResponse(client.execute(method));
     
      if (response.getStatusCode() == HttpStatus.SC_UNAUTHORIZED) {
        method.abort();
        if(login()) {
          method = new HttpDelete(deleteUri);
          method.getParams().setIntParameter("http.socket.timeout", connectionTimeOut);
          method.setHeader(FilesConstants.X_AUTH_TOKEN, authToken);
          if (emailAddresses != null) {
View Full Code Here

      else {
        throw new FilesException("Unexpected server response",response.getResponseHeaders(), response.getStatusLine());
      }
    }
    finally {
      if (method != null) method.abort();
    }

    }

    /**
 
View Full Code Here

      }
   
      FilesResponse response = new FilesResponse(client.execute(method));
     
      if (response.getStatusCode() == HttpStatus.SC_UNAUTHORIZED) {
        method.abort();
        if(login()) {
          method = new HttpDelete(deleteUri);
          method.getParams().setIntParameter("http.socket.timeout", connectionTimeOut);
          method.setHeader(FilesConstants.X_AUTH_TOKEN, authToken);
          if (emailAddresses != null) {
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.