Browse Source

No longer using Files.isRegularFile(), fixing "add existing vault located on OneDrive's FoD"

Sebastian Stenzel 7 years ago
parent
commit
a66e08ee9b

+ 0 - 1
main/launcher/src/test/java/org/cryptomator/launcher/FileOpenRequestHandlerTest.java

@@ -32,7 +32,6 @@ public class FileOpenRequestHandlerTest {
 		Mockito.when(fs.provider()).thenReturn(provider);
 		Mockito.when(fs.getPath(Mockito.anyString())).thenReturn(p1, p2);
 		Mockito.when(provider.readAttributes(Mockito.any(), Mockito.eq(BasicFileAttributes.class))).thenReturn(attrs);
-		Mockito.when(attrs.isRegularFile()).thenReturn(true);
 
 		BlockingQueue<Path> queue = new ArrayBlockingQueue<>(10);
 		FileOpenRequestHandler handler = new FileOpenRequestHandler(queue);

+ 1 - 1
main/ui/src/main/java/org/cryptomator/ui/controllers/MainController.java

@@ -315,7 +315,7 @@ public class MainController implements ViewController {
 		final Path vaultPath;
 		if (path != null && Files.isDirectory(path)) {
 			vaultPath = path;
-		} else if (path != null && Files.isRegularFile(path)) {
+		} else if (path != null && Files.isReadable(path)) {
 			vaultPath = path.getParent();
 		} else {
 			LOG.warn("Ignoring attempt to add vault with invalid path: {}", path);