Example usage for org.apache.http.client.methods HttpOptionsHC4 HttpOptionsHC4

List of usage examples for org.apache.http.client.methods HttpOptionsHC4 HttpOptionsHC4

Introduction

In this page you can find the example usage for org.apache.http.client.methods HttpOptionsHC4 HttpOptionsHC4.

Prototype

public HttpOptionsHC4(final String uri) 

Source Link

Usage

From source file:com.granita.icloudcalsync.webdav.WebDavResource.java

public void options() throws URISyntaxException, IOException, HttpException {
    HttpOptionsHC4 options = new HttpOptionsHC4(location);

    @Cleanup//from   w  ww  . ja va  2s  . c  om
    CloseableHttpResponse response = httpClient.execute(options, context);
    checkResponse(response);

    Header[] allowHeaders = response.getHeaders("Allow");
    for (Header allowHeader : allowHeaders)
        methods.addAll(Arrays.asList(allowHeader.getValue().split(", ?")));

    Header[] capHeaders = response.getHeaders("DAV");
    for (Header capHeader : capHeaders)
        capabilities.addAll(Arrays.asList(capHeader.getValue().split(", ?")));
}