Example usage for org.apache.commons.httpclient.methods HeadMethod getName

List of usage examples for org.apache.commons.httpclient.methods HeadMethod getName

Introduction

In this page you can find the example usage for org.apache.commons.httpclient.methods HeadMethod getName.

Prototype

public String getName() 

Source Link

Usage

From source file:org.osaf.caldav4j.CalDAVCollection.java

public int testConnection(HttpClient httpClient) throws CalDAV4JException {
    HeadMethod method = new HeadMethod();
    method.setPath(getCalendarCollectionRoot());
    try {//w w  w .  j  a v  a  2s  .c  o  m
        httpClient.executeMethod(hostConfiguration, method);
    } catch (Exception e) {
        throw new CalDAV4JException(e.getMessage(), new Throwable(e.getCause()));
    }

    switch (method.getStatusCode()) {
    case CaldavStatus.SC_OK:
        break;
    default:
        throw new BadStatusException(method.getStatusCode(), method.getName(), getCalendarCollectionRoot());
    }
    return method.getStatusCode();
}