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
+1
View File
@@ -0,0 +1 @@
/target/
+27
View File
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2016 Sebastian Stenzel
This file is licensed under the terms of the MIT license.
See the LICENSE.txt file for more info.
Contributors:
Sebastian Stenzel - initial API and implementation
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.cryptomator</groupId>
<artifactId>main</artifactId>
<version>0.11.0-SNAPSHOT</version>
</parent>
<artifactId>frontend-api</artifactId>
<name>Cryptomator frontend: API</name>
<description>API for filesystem frontends</description>
<dependencies>
<dependency>
<groupId>org.cryptomator</groupId>
<artifactId>filesystem-api</artifactId>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,18 @@
package org.cryptomator.frontend;
import java.util.Map;
import java.util.Optional;
public interface Frontend extends AutoCloseable {
public enum MountParam {
MOUNT_NAME, WIN_DRIVE_LETTER
}
boolean mount(Map<MountParam, Optional<String>> map);
void unmount();
void reveal();
}
@@ -0,0 +1,9 @@
package org.cryptomator.frontend;
public class FrontendCreationFailedException extends Exception {
public FrontendCreationFailedException(Throwable cause) {
super(cause);
}
}
@@ -0,0 +1,17 @@
package org.cryptomator.frontend;
import org.cryptomator.filesystem.Folder;
public interface FrontendFactory {
/**
* Provides a new frontend to access the given folder.
*
* @param root Root resource accessible through this frontend.
* @param uniqueName Name of the frontend, i.e. used to create subresources for the different frontends inside of a common virtual drive.
* @return A new frontend
* @throws FrontendCreationFailedException If creation was not possible.
*/
Frontend create(Folder root, String uniqueName) throws FrontendCreationFailedException;
}
@@ -0,0 +1,12 @@
/*******************************************************************************
* Copyright (c) 2015 Sebastian Stenzel and others.
* This file is licensed under the terms of the MIT license.
* See the LICENSE.txt file for more info.
*
* Contributors:
* Sebastian Stenzel - initial API and implementation
*******************************************************************************/
/**
* Provides frontends for {@link org.cryptomator.filesystem.FileSystem FileSystems}.
*/
package org.cryptomator.frontend;