]> git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.util/src/org/argeo/util/dav/DavServerHandler.java
Improve ACR, introduce migration from JCR.
[lgpl/argeo-commons.git] / org.argeo.util / src / org / argeo / util / dav / DavServerHandler.java
1 package org.argeo.util.dav;
2
3 import java.io.IOException;
4
5 import org.argeo.util.http.HttpMethod;
6
7 import com.sun.net.httpserver.HttpExchange;
8 import com.sun.net.httpserver.HttpHandler;
9
10 public class DavServerHandler implements HttpHandler {
11
12 @Override
13 public void handle(HttpExchange exchange) throws IOException {
14 String method = exchange.getRequestMethod();
15 if (DavMethod.PROPFIND.name().equals(method)) {
16 handle(exchange);
17 } else if (HttpMethod.GET.name().equals(method)) {
18 exchange.getResponseBody().write("Hello Dav!".getBytes());
19 } else {
20 throw new IllegalArgumentException("Unsupported method " + method);
21 }
22
23 }
24
25 protected DavResponse handlePROPFIND(HttpExchange exchange) {
26 return null;
27 }
28
29 }