Package org.apache.http.client.methods

Examples of org.apache.http.client.methods.HttpDelete


    public static HttpAsyncRequestProducer createDelete(final URI requestURI) {
        return create(new HttpDelete(requestURI));
    }

    public static HttpAsyncRequestProducer createDelete(final String requestURI) {
        return create(new HttpDelete(URI.create(requestURI)));
    }
View Full Code Here


 
  public void execute(String documentURI)
      throws ManifoldCFException, ServiceInterruption
  {
      String idField = URLEncoder.encode(documentURI);
      HttpDelete method = new HttpDelete(config.getServerLocation() +
          "/" + config.getIndexName() + "/" + config.getIndexType()
          + "/" + idField);
      call(method);
      String error = checkJson(jsonException);
      if (getResult() == Result.OK && error == null)
View Full Code Here

          if( time != null ) {
            timeURIPart = time.toString();
          }

          URIBuilder uri = uri( HBase.SERVICE_PATH, "/", tableName, "/", rowsIdToQuery, columnsURIPart.toString(), timeURIPart );
          HttpDelete delete = new HttpDelete( uri.build() );
          return new Response( execute( delete ) );
        }
      };
    }
View Full Code Here

  }

  @Override
  public void doDelete( URI url, HttpServletRequest request, HttpServletResponse response )
      throws IOException, URISyntaxException {
    HttpDelete method = new HttpDelete( url );
    copyRequestHeaderFields( method, request );
    executeRequest( method, request, response );
  }
View Full Code Here

    protected Callable<Response> callable() {
      return new Callable<Response>() {
        @Override
        public Response call() throws Exception {
          URIBuilder uri = uri( HBase.SERVICE_PATH, "/", tableName, "/schema" );
          HttpDelete delete = new HttpDelete( uri.build() );
          return new Response( execute( delete ) );
        }
      };
    }
View Full Code Here

    protected Callable<Response> callable() {
      return new Callable<Response>() {
        @Override
        public Response call() throws Exception {
          URIBuilder uri = uri( HBase.SERVICE_PATH, "/", tableName, "/scanner/", scannerId );
          HttpDelete request = new HttpDelete( uri.build() );
          return new Response( execute( request ) );
        }
      };
    }
View Full Code Here

        @Override
        public Response call() throws Exception {
          URIBuilder uri = uri( Hdfs.SERVICE_PATH, file );
          addQueryParam( uri, "op", "DELETE" );
          addQueryParam( uri, "recursive", recursive );
          HttpDelete request = new HttpDelete( uri.build() );
          return new Response( execute( request ) );
        }
      };
    }
View Full Code Here

        if (url.getProtocol() != null &&
            url.getProtocol().equalsIgnoreCase("https")) {
            setupClientSSL(httpclient, url.getPort());
        }

        HttpDelete httpdel = new HttpDelete(tsUrl + "/" + URLEncoder.encode(token, "UTF-8"));

        httpdel.setHeader("Accept", "application/json");
        httpdel.setHeader("Accept-Charset", "UTF-8");
        httpdel.setHeader("Authorization", request.getHeader("Authorization"));
        httpdel.setHeader("TS-URL", request.getHeader("TS-URL"));


        // Execute the request
        HttpResponse authResponse = httpclient.execute(httpdel);

        int status = authResponse.getStatusLine().getStatusCode();
        if (status == 404) {
            LOGGER.info("The authentication server " + tsUrl + " was not found.");
            returnError(response, "The token server URL was not found",
                        RESTAuthConstants.NOTFOUND_TS_URL);
            return;
        }

        // Get hold of the response entity
        HttpEntity entity = authResponse.getEntity();

        StringBuffer authResponseData = new StringBuffer();

        // If the response does not enclose an entity, there is no need
        // to worry about connection release
        if (entity != null) {
            InputStream instream = entity.getContent();
            BufferedReader reader = null;
            try {
                reader = new BufferedReader(new InputStreamReader(instream));

                // do something useful with the response
                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

  public void delete() throws ParseException
  {
    try
    {
      HttpClient httpclient = new DefaultHttpClient();
      HttpDelete httpdelete = new HttpDelete(Parse.getParseAPIUrlClasses() + mClassName + "/"
          + getObjectId());
      httpdelete.addHeader("X-Parse-Application-Id", Parse.getApplicationId());
      httpdelete.addHeader("X-Parse-REST-API-Key", Parse.getRestAPIKey());

      HttpResponse httpresponse = httpclient.execute(httpdelete);
      HttpEntity entity = httpresponse.getEntity();

      ParseResponse response = new ParseResponse(httpresponse);
View Full Code Here

     *                                The container doesn't exist
     * @throws ch.iterate.openstack.swift.exception.ContainerNotEmptyException
     *                                The container was not empty
     */
    public void deleteContainer(Region region, String name) throws IOException {
        HttpDelete method = new HttpDelete(region.getStorageUrl(name));
        Response response = this.execute(method, new DefaultResponseHandler());
        if(response.getStatusCode() == HttpStatus.SC_CONFLICT) {
            throw new ContainerNotEmptyException(response);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.http.client.methods.HttpDelete

Copyright © 2018 www.massapicom. 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.