Package org.apache.commons.httpclient.methods

Examples of org.apache.commons.httpclient.methods.HeadMethod


        update(uri, relPath, new String[] {vUri}, UpdateInfo.UPDATE_BY_VERSION, removeExisting, sessionInfo);
    }

    private boolean exists(SessionInfo sInfo, String uri) {
        HeadMethod method = new HeadMethod(uri);
        try {
            int statusCode = getClient(sInfo).executeMethod(method);
            if (statusCode == DavServletResponse.SC_OK) {
                return true;
            }
        } catch (IOException e) {
            log.error("Unexpected error while testing existence of item.",e);
        } catch (RepositoryException e) {
            log.error(e.getMessage());
        } finally {
            method.releaseConnection();
        }
        return false;
    }
View Full Code Here


      if (method.equals(POST)) {
          httpMethod = new PostMethod(urlStr);
      } else if (method.equals(PUT)){
          httpMethod = new PutMethod(urlStr);
      } else if (method.equals(HEAD)){
          httpMethod = new HeadMethod(urlStr);
      } else if (method.equals(TRACE)){
          httpMethod = new TraceMethod(urlStr);
      } else if (method.equals(OPTIONS)){
          httpMethod = new OptionsMethod(urlStr);
      } else if (method.equals(DELETE)){
View Full Code Here

            if (method.equals(HTTPConstants.POST)) {
                httpMethod = new PostMethod(urlStr);
            } else if (method.equals(HTTPConstants.PUT)){
                httpMethod = new PutMethod(urlStr);
            } else if (method.equals(HTTPConstants.HEAD)){
                httpMethod = new HeadMethod(urlStr);
            } else if (method.equals(HTTPConstants.TRACE)){
                httpMethod = new TraceMethod(urlStr);
            } else if (method.equals(HTTPConstants.OPTIONS)){
                httpMethod = new OptionsMethod(urlStr);
            } else if (method.equals(HTTPConstants.DELETE)){
View Full Code Here

     */
    @Override
    protected FileType doGetType() throws Exception
    {
        // Use the HEAD method to probe the file.
        method = new HeadMethod();
        setupMethod(method);
        final HttpClient client = fileSystem.getClient();
        final int status = client.executeMethod(method);
        method.releaseConnection();
        if (status == HttpURLConnection.HTTP_OK)
View Full Code Here

                    new UsernamePasswordCredentials(username, password);
                AuthScope scope = new AuthScope(hostname, AuthScope.ANY_PORT);
                client.getState().setCredentials(scope, creds);
            }

            client.executeMethod(new HeadMethod());
        }
        catch (final Exception exc)
        {
            throw new FileSystemException("vfs.provider.http/connect.error", new Object[]{hostname}, exc);
        }
View Full Code Here

    if (Transfer.GET_METHOD.equalsIgnoreCase(method))
      return new GetMethod(url);
    if (Transfer.DELETE_METHOD.equalsIgnoreCase(method))
      return new DeleteMethod(url);
    if (Transfer.HEAD_METHOD.equalsIgnoreCase(method))
      return new HeadMethod(url);
    throw new IllegalArgumentException("un supported http method: " + method);
  }
View Full Code Here

            break;
         case POST:
            request = new PostMethod(url.toString());
            break;
         case HEAD:
            request = new HeadMethod(url.toString());
            break;
         case OPTIONS:
            request = new OptionsMethod(url.toString());
            break;
         case PUT:
View Full Code Here

    }

    public void testHead() throws Exception
    {
        HttpClient client = new HttpClient();
        method = new HeadMethod(((InboundEndpoint) muleClient.getMuleContext().getRegistry().lookupObject("inHttpIn")).getAddress());
        int statusCode = client.executeMethod(method);
        assertEquals(Integer.toString(HttpStatus.SC_OK), Integer.toString(statusCode));

    }
View Full Code Here

    }

    protected HttpMethod createHeadMethod(MuleMessage message) throws Exception
    {
        URI uri = getURI(message);
        return new HeadMethod(uri.toString());
    }
View Full Code Here

    } else if (method.equalsIgnoreCase(DELETE)) {
      httpMethod = new DeleteMethod();
    } else if (method.equalsIgnoreCase(PUT)) {
      httpMethod = new PutMethod();
    } else if (method.equalsIgnoreCase(HEAD)) {
      httpMethod = new HeadMethod();
    } else if (method.equalsIgnoreCase(OPTIONS)) {
      httpMethod = new OptionsMethod();
    } else if (method.equalsIgnoreCase(TRACE)) {
      httpMethod = new TraceMethod(uri.toString());
    } else {
View Full Code Here

TOP

Related Classes of org.apache.commons.httpclient.methods.HeadMethod

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.