HttpState httpState = new HttpState();
httpState.setCredentials(null, host, credentials);
putMethod.setRequestBody(resource.getInputStream());
putMethod.setRequestHeader("Content-type", resource.getContentType());
putMethod.setRequestHeader("Content-length", String.valueOf(resource.getContentLength()));
putMethod.execute(httpState, new HttpConnection(host, port, protocol));
}
public void removeResource(URI uri, Credentials credentials) throws IOException {
String url = domain+uri.toString();
DeleteMethod deleteMethod = new DeleteMethod(url);