Merge pull request #64 in ITERATE/cyberduck from feature/windows/9074 to master
[cyberduck.git] / source / ch / cyberduck / core / dav / DAVClient.java
blob7d04fb31bddd0b431baf094c9fc90d3c112d2157
1 package ch.cyberduck.core.dav;
3 /*
4 * Copyright (c) 2013 David Kocher. All rights reserved.
5 * http://cyberduck.ch/
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * Bug fixes, suggestions and comments should be sent to:
18 * feedback@cyberduck.ch
21 import org.apache.http.HttpResponse;
22 import org.apache.http.client.ResponseHandler;
23 import org.apache.http.client.methods.HttpRequestBase;
24 import org.apache.http.impl.client.HttpClientBuilder;
26 import java.io.IOException;
27 import java.net.URI;
29 import com.github.sardine.impl.SardineImpl;
31 /**
32 * @version $Id$
34 public class DAVClient extends SardineImpl {
36 private String uri;
38 public DAVClient(final String uri, final HttpClientBuilder http) {
39 super(http);
40 this.uri = uri;
43 @Override
44 public <T> T execute(final HttpRequestBase request, final ResponseHandler<T> responseHandler) throws IOException {
45 request.setURI(URI.create(uri + request.getURI().getRawPath()));
46 return super.execute(request, responseHandler);
49 @Override
50 protected HttpResponse execute(final HttpRequestBase request) throws IOException {
51 request.setURI(URI.create(uri + request.getURI().getRawPath()));
52 return super.execute(request);