first compile-clean attempt to integrate the layered I/O subsystem with the existing UI

This commit is contained in:
Sebastian Stenzel
2016-01-26 20:17:33 +01:00
parent e4d626eef5
commit c56d0b7d4a
42 changed files with 539 additions and 430 deletions
@@ -6,8 +6,9 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
*******************************************************************************/
package org.cryptomator.webdav.server;
package org.cryptomator.frontend.webdav;
import java.net.URI;
import java.nio.ByteBuffer;
import java.util.EnumSet;
@@ -27,7 +28,7 @@ public class InMemoryWebDavServer {
server.start();
FileSystem fileSystem = setupFilesystem();
ServletContextHandler servlet = server.addServlet(fileSystem, "/foo");
ServletContextHandler servlet = server.addServlet(fileSystem, URI.create("http://localhost:8080/foo"));
servlet.addFilter(LoggingHttpFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST));
servlet.start();
@@ -6,12 +6,13 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
*******************************************************************************/
package org.cryptomator.webdav.server;
package org.cryptomator.frontend.webdav;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UncheckedIOException;
import java.net.URI;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
@@ -36,7 +37,7 @@ public class NioWebDavServer {
server.start();
FileSystem fileSystem = setupFilesystem();
ServletContextHandler servlet = server.addServlet(fileSystem, "/foo");
ServletContextHandler servlet = server.addServlet(fileSystem, URI.create("http://localhost:8080/foo"));
servlet.addFilter(LoggingHttpFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST));
servlet.start();
@@ -1,9 +1,10 @@
package org.cryptomator.webdav.server;
package org.cryptomator.frontend.webdav;
import static org.hamcrest.collection.IsArrayContaining.hasItemInArray;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.ByteBuffer;
@@ -49,7 +50,7 @@ public class WebDavServerTest {
@Before
public void startServlet() throws Exception {
fs = new InMemoryFileSystem();
servlet = SERVER.addServlet(fs, "/test");
servlet = SERVER.addServlet(fs, URI.create("http://localhost:" + SERVER.getPort() + "/test"));
servlet.start();
servletRoot = "http://localhost:" + SERVER.getPort() + "/test";
}