JDK HTTP server authentication
[lgpl/argeo-commons.git] / org.argeo.util / src / org / argeo / util / dav / DavServerHandler.java
index 4fc73f3ce4778101a5f1d0d721a3276fa6e9d257..f9fba4761c62b26a91616f3afa64a0e69609ef75 100644 (file)
@@ -2,6 +2,8 @@ package org.argeo.util.dav;
 
 import java.io.IOException;
 
+import org.argeo.util.http.HttpMethod;
+
 import com.sun.net.httpserver.HttpExchange;
 import com.sun.net.httpserver.HttpHandler;
 
@@ -12,6 +14,8 @@ public class DavServerHandler implements HttpHandler {
                String method = exchange.getRequestMethod();
                if (DavMethod.PROPFIND.name().equals(method)) {
                        handle(exchange);
+               } else if (HttpMethod.GET.name().equals(method)) {
+                       exchange.getResponseBody().write("Hello Dav!".getBytes());
                } else {
                        throw new IllegalArgumentException("Unsupported method " + method);
                }