Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Commit

Permalink
Merge branch 'release/1.2.3' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
overheadhunter committed Jan 21, 2021
2 parents 3b4ee92 + 8a30f8a commit bfa0d18
Show file tree
Hide file tree
Showing 14 changed files with 60 additions and 51 deletions.
32 changes: 12 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,36 +1,28 @@
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.ear
*.zip
*.tar.gz
*.rar

# Eclipse Settings Files #
.settings
.project
.classpath
target/
test-output/

# IntelliJ Settings Files #
.idea/
out/
.idea_modules/
# Maven #
target/
pom.xml.versionsBackup

# IntelliJ Settings Files (https://intellij-support.jetbrains.com/hc/en-us/articles/206544839-How-to-manage-projects-under-Version-Control-Systems) #
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries
.idea/compiler.xml
.idea/encodings.xml
.idea/jarRepositories.xml
.idea/**/libraries/
*.iml
*.iws

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
Expand Down
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.cryptomator</groupId>
<artifactId>dokany-nio-adapter</artifactId>
<version>1.2.2</version>
<version>1.2.3</version>
<description>Access resources at a given NIO path via Dokany.</description>
<name>Dokany-NIO Adapter</name>
<url>https://github.com/cryptomator/dokany-nio-adapter</url>
Expand All @@ -18,13 +18,14 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>11</maven.compiler.release>

<slf4j.version>1.7.25</slf4j.version>
<slf4j.version>1.7.27</slf4j.version>
<logback.version>1.2.3</logback.version>
<guava.version>30.0-jre</guava.version>
<jna.version>5.6.0</jna.version>
<jna-platform.version>5.5.0</jna-platform.version>
<commons.cli.version>1.4</commons.cli.version>
<commons-io.version>2.6</commons-io.version>

<!-- Test -->
<junit.jupiter.version>5.7.0</junit.jupiter.version>
<mockito.version>2.24.0</mockito.version>
</properties>
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/com/dokany/java/DokanyMount.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.dokany.java.constants.MountError;
import com.dokany.java.structure.DeviceOptions;
import org.cryptomator.frontend.dokany.Mount;
import org.cryptomator.frontend.dokany.RevealException;
import org.cryptomator.frontend.dokany.Revealer;
import org.cryptomator.frontend.dokany.SafeUnmountCheck;
import org.slf4j.Logger;
Expand All @@ -16,7 +15,6 @@
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.function.Consumer;

/**
* Main class to start and stop Dokany file system.
Expand Down Expand Up @@ -171,7 +169,7 @@ public void unmountForced() {


@Override
public void reveal(Revealer revealer) throws RevealException {
public void reveal(Revealer revealer) throws Exception {
revealer.reveal(Path.of(deviceOptions.MountPoint.toString()));
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cryptomator/frontend/dokany/Mount.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ public interface Mount extends AutoCloseable {

void unmountForced();

void reveal(Revealer revealer) throws RevealException;
void reveal(Revealer revealer) throws Exception;

}
16 changes: 0 additions & 16 deletions src/main/java/org/cryptomator/frontend/dokany/RevealException.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
@FunctionalInterface
public interface Revealer {

void reveal(Path path) throws RevealException;
void reveal(Path path) throws Exception;

}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static void main(String[] args) throws IOException, MountFailedException
try (Mount mount = mountFactory.mount(path, mountPoint, "MyVault", "CryptoFS")) {
try {
mount.reveal(new WindowsExplorerRevealer());
} catch (RevealException e) {
} catch (Exception e) {
System.out.println("Unable to reveal.");
e.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static void main(String[] args) throws IOException, MountFailedException
try (Mount mount = mountFactory.mount(dirPath, mountPoint, "Test", "DokanyNioFS")) {
try {
mount.reveal(new WindowsExplorerRevealer());
} catch (RevealException e) {
} catch (Exception e) {
System.out.println("Unable to reveal.");
e.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@

/**
* A simple mount revealer which opens the windows explorer.
* <p>
* TODO: maybe throw an exception on error.
*/
public class WindowsExplorerRevealer implements Revealer {

private static final int REVEAL_TIMEOUT_MS = 5000;

@Override
public void reveal(Path path) {
public void reveal(Path path) throws TimeoutException, IOException {
var pb = new ProcessBuilder("explorer", "/root,", path.toString());
try {
Process proc = pb.start();
Expand All @@ -25,8 +23,6 @@ public void reveal(Path path) {
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
} catch (IOException | TimeoutException e) {
e.printStackTrace();
}
}
}

0 comments on commit bfa0d18

Please sign in to comment.