Examples of HttpHead


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

    this.httpclient = httpclient;
  }
 
  public boolean exists(URI uri) throws IOException
  {
    HttpHead httphead = new HttpHead(uri);
    HttpResponse response = httpclient.execute(httphead);
    return response.getStatusLine().getStatusCode() == HttpStatus.SC_OK;
  }
View Full Code Here

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

            LOG.trace("HTTP GET consumer thread starting: " + this);
        }
        HttpClient httpClient = getReceiveHttpClient();
        URI remoteUrl = getRemoteUrl();

        HttpHead httpMethod = new HttpHead(remoteUrl.toString());
        configureMethod(httpMethod);

        // Request the options from the server so we can find out if the broker we are
        // talking to supports GZip compressed content.  If so and useCompression is on
        // then we can compress our POST data, otherwise we must send it uncompressed to
View Full Code Here

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

            if (method.equals(HTTPConstants.POST)) {
                httpRequest = new HttpPost(uri);
            } else if (method.equals(HTTPConstants.PUT)) {
                httpRequest = new HttpPut(uri);
            } else if (method.equals(HTTPConstants.HEAD)) {
                httpRequest = new HttpHead(uri);
            } else if (method.equals(HTTPConstants.TRACE)) {
                httpRequest = new HttpTrace(uri);
            } else if (method.equals(HTTPConstants.OPTIONS)) {
                httpRequest = new HttpOptions(uri);
            } else if (method.equals(HTTPConstants.DELETE)) {
View Full Code Here

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

@ContextConfiguration(locations = "classpath:/storageContext.xml")
public class TestHttp extends AbstractTestNGSpringContextTests {
    @Test
    @Parameters("template-url")
    public void testHttpclient(String templateUrl) {
        HttpHead method = new HttpHead(templateUrl);
        DefaultHttpClient client = new DefaultHttpClient();

        OutputStream output = null;
        long length = 0;
        try {
View Full Code Here

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

        switch (componentConfig.getHttpMethod()) {
        case GET:
            method = new HttpGet(componentConfig.getEndPointUrl().toExternalForm());
            break;
        case HEAD:
            method = new HttpHead(componentConfig.getEndPointUrl().toExternalForm());
            break;
        default:
            throw new RuntimeException("Unsupported http method: '" + componentConfig.getHttpMethod() + "'");
        }
        Boolean followRedirects = pluginConfig.getSimple(ConfigKeys.FOLOW_REDIRECTS).getBooleanValue();
View Full Code Here

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

            final HttpResponse response,
            final HttpContext context) throws ProtocolException {
        URI uri = this.handler.getLocationURI(response, context);
        String method = request.getRequestLine().getMethod();
        if (method.equalsIgnoreCase(HttpHead.METHOD_NAME)) {
            return new HttpHead(uri);
        } else {
            return new HttpGet(uri);
        }
    }
View Full Code Here

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

            final HttpResponse response,
            final HttpContext context) throws ProtocolException {
        URI uri = getLocationURI(request, response, context);
        String method = request.getRequestLine().getMethod();
        if (method.equalsIgnoreCase(HttpHead.METHOD_NAME)) {
            return new HttpHead(uri);
        } else {
            return new HttpGet(uri);
        }
    }
View Full Code Here

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

        return doHead(target(graphName)) ;
    }

    private boolean doHead(String url)
    {
        HttpUriRequest httpHead = new HttpHead(url) ;
        try {
            HttpOp.execHttpHead(url, WebContent.defaultGraphAcceptHeader, noResponse, null, null, this.authenticator) ;
            return true ;
        } catch (HttpException ex) {
            if ( ex.getResponseCode() == HttpSC.NOT_FOUND_404 )
View Full Code Here

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

            if (method.equals(HTTPConstants.POST)) {
                httpRequest = new HttpPost(uri);
            } else if (method.equals(HTTPConstants.PUT)) {
                httpRequest = new HttpPut(uri);
            } else if (method.equals(HTTPConstants.HEAD)) {
                httpRequest = new HttpHead(uri);
            } else if (method.equals(HTTPConstants.TRACE)) {
                httpRequest = new HttpTrace(uri);
            } else if (method.equals(HTTPConstants.OPTIONS)) {
                httpRequest = new HttpOptions(uri);
            } else if (method.equals(HTTPConstants.DELETE)) {
View Full Code Here

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

        }
        httpMethod = enclosingMethod;
      } else if ("GET".equals(methodType)) {
        httpMethod = new HttpGet(requestUri);
      } else if ("HEAD".equals(methodType)) {
        httpMethod = new HttpHead(requestUri);
      } else if ("DELETE".equals(methodType)) {
        httpMethod = new HttpDelete(requestUri);
      }
      for (Map.Entry<String, List<String>> entry : request.getHeaders().entrySet()) {
        httpMethod.addHeader(entry.getKey(), StringUtils.join(entry.getValue(), ','));
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.