Package org.apache.http.client.methods

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


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

    }

    /**
 
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();
                login();
                   method = new HttpDelete(getStorageURL()+"/"+sanitizeForURI(container)+"/"+sanitizeForURI(objName));
                  method.getParams().setIntParameter("http.socket.timeout", connectionTimeOut);
                method.getParams().setIntParameter("http.socket.timeout", connectionTimeOut);
                method.setHeader(FilesConstants.X_AUTH_TOKEN, authToken);
View Full Code Here

            else {
              throw new FilesException("Unexpected status from server", response.getResponseHeaders(), response.getStatusLine());
            }
          }
          finally {
            if (method != null) method.abort();
          }
        }
        else
        {
          if (!isValidObjectName(objName)) {
View Full Code Here

                return responseBody.getBoolean("boolean" );
            } else {
                return false;
            }
        } catch (IOException e) {
            method.abort();
            throw e;
        }
    }

    /**
 
View Full Code Here

        HttpResponse response = client.execute(cmd);
        int code = response.getStatusLine().getStatusCode();

        credentials.checkCode(response,code,"DELETE:" + container +":" + key);
        cmd.abort();   
    }

    public JsonNode list(String container,String prefix, String delimiter, int limit, String marker) throws Exception {
        String q = "?format=json";
        if (limit > 0) {
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

      // 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

            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(storageURL+"/"+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

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.