クリストファーありがとう!
サンプルアプリケーションを使用してwebdavフォルダーを作成するコードを説明したいと思います。
public class CreateWebdavFolderUsingHttpClient {
private static String url = "http://localhost:8081/webdav/subbu/MyWebdavFolder";
public static void main(String[] args) {
String response = null;
/* Create an instance of HttpClient.*/
HttpClient client = new HttpClient();
client.getState().setCredentials(
new AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT),
new UsernamePasswordCredentials("tomcat", "tomcat"));
DavMethod method = new MkColMethod(url);
try {
client.executeMethod(method);
response = method.getStatusCode() + " - " + method.getStatusText();
client.executeMethod(new MkColMethod(url + "/10300"));
response = method.getStatusCode() + " - " + method.getStatusText();
} catch (IOException ex) {
// Catch error
} finally {
method.releaseConnection();
}
System.out.println(response);
}
}