Skip to content

Commit 5c7515f

Browse files
committed
Merge branch 'release/1.2.0'
2 parents a21e678 + 4e572d7 commit 5c7515f

File tree

19 files changed

+602
-27
lines changed

19 files changed

+602
-27
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ jobs:
77
runs-on: ubuntu-latest
88
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
99
steps:
10-
- uses: actions/checkout@v2
11-
- uses: actions/setup-java@v2
10+
- uses: actions/checkout@v3
11+
- uses: actions/setup-java@v3
1212
with:
1313
distribution: 'temurin'
1414
java-version: 17
@@ -19,12 +19,12 @@ jobs:
1919
- name: Build and Test
2020
id: buildAndTest
2121
run: mvn -B clean install
22-
- uses: actions/upload-artifact@v2
22+
- uses: actions/upload-artifact@v3
2323
with:
2424
name: artifacts
2525
path: target/*.jar
2626
- name: Create Release
27-
uses: actions/create-release@v1
27+
uses: actions/create-release@v1 # NOTE: action is unmaintained and repo archived
2828
if: startsWith(github.ref, 'refs/tags/')
2929
env:
3030
GITHUB_TOKEN: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }} # release as "cryptobot"

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ jobs:
1515
runs-on: ubuntu-latest
1616
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v3
1919
with:
2020
fetch-depth: 2
21-
- uses: actions/setup-java@v2
21+
- uses: actions/setup-java@v3
2222
with:
2323
distribution: 'temurin'
2424
java-version: 17
2525
cache: 'maven'
2626
- name: Initialize CodeQL
27-
uses: github/codeql-action/init@v1
27+
uses: github/codeql-action/init@v2
2828
with:
2929
languages: java
3030
- name: Build
3131
run: mvn -B compile
3232
- name: Perform CodeQL Analysis
33-
uses: github/codeql-action/analyze@v1
33+
uses: github/codeql-action/analyze@v2

.github/workflows/publish-central.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
publish:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1414
with:
1515
ref: "refs/tags/${{ github.event.inputs.tag }}"
16-
- uses: actions/setup-java@v2
16+
- uses: actions/setup-java@v3
1717
with:
1818
distribution: 'temurin'
1919
java-version: 17

.github/workflows/publish-github.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ jobs:
77
runs-on: ubuntu-latest
88
if: startsWith(github.ref, 'refs/tags/') # only allow publishing tagged versions
99
steps:
10-
- uses: actions/checkout@v2
11-
- uses: actions/setup-java@v2
10+
- uses: actions/checkout@v3
11+
- uses: actions/setup-java@v3
1212
with:
1313
distribution: 'temurin'
1414
java-version: 17

pom.xml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>org.cryptomator</groupId>
77
<artifactId>integrations-api</artifactId>
8-
<version>1.1.0</version>
8+
<version>1.2.0</version>
99

1010
<name>Cryptomator Integrations API</name>
1111
<description>Defines optional service interfaces that may be used by Cryptomator</description>
@@ -59,13 +59,13 @@
5959
<dependency>
6060
<groupId>org.junit.jupiter</groupId>
6161
<artifactId>junit-jupiter</artifactId>
62-
<version>5.8.2</version>
62+
<version>5.9.0</version>
6363
<scope>test</scope>
6464
</dependency>
6565
<dependency>
6666
<groupId>org.mockito</groupId>
6767
<artifactId>mockito-core</artifactId>
68-
<version>4.3.1</version>
68+
<version>4.8.0</version>
6969
<scope>test</scope>
7070
</dependency>
7171
</dependencies>
@@ -92,6 +92,11 @@
9292
</execution>
9393
</executions>
9494
</plugin>
95+
<plugin>
96+
<groupId>org.apache.maven.plugins</groupId>
97+
<artifactId>maven-surefire-plugin</artifactId>
98+
<version>3.0.0-M7</version>
99+
</plugin>
95100
<plugin>
96101
<artifactId>maven-javadoc-plugin</artifactId>
97102
<version>3.2.0</version>

src/main/java/module-info.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.cryptomator.integrations.mount.MountService;
2+
import org.cryptomator.integrations.revealpath.RevealPathService;
13
import org.cryptomator.integrations.tray.TrayMenuController;
24
import org.cryptomator.integrations.autostart.AutoStartProvider;
35
import org.cryptomator.integrations.keychain.KeychainAccessProvider;
@@ -12,11 +14,15 @@
1214
exports org.cryptomator.integrations.autostart;
1315
exports org.cryptomator.integrations.common;
1416
exports org.cryptomator.integrations.keychain;
17+
exports org.cryptomator.integrations.mount;
18+
exports org.cryptomator.integrations.revealpath;
1519
exports org.cryptomator.integrations.tray;
1620
exports org.cryptomator.integrations.uiappearance;
1721

1822
uses AutoStartProvider;
1923
uses KeychainAccessProvider;
24+
uses MountService;
25+
uses RevealPathService;
2026
uses TrayIntegrationProvider;
2127
uses TrayMenuController;
2228
uses UiAppearanceProvider;
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
package org.cryptomator.integrations.mount;
2+
3+
import java.io.IOException;
4+
5+
/**
6+
* Handle to control the lifecycle of a mounted file system.
7+
* <p>
8+
* Created by {@link MountBuilder}
9+
*/
10+
public interface Mount extends AutoCloseable {
11+
12+
/**
13+
* Returns the absolute OS path, where this mount can be accessed.
14+
*
15+
* @return Absolute path to the mountpoint.
16+
*/
17+
Mountpoint getMountpoint();
18+
19+
/**
20+
* Unmounts the mounted Volume.
21+
* <p>
22+
* If possible, attempt a graceful unmount.
23+
*
24+
* @throws UnmountFailedException If the unmount was not successful.
25+
* @see #unmountForced()
26+
*/
27+
void unmount() throws UnmountFailedException;
28+
29+
/**
30+
* If supported, force-unmount the volume.
31+
*
32+
* @throws UnmountFailedException If the unmount was not successful.
33+
* @throws UnsupportedOperationException If {@link MountCapability#UNMOUNT_FORCED} is not supported
34+
*/
35+
default void unmountForced() throws UnmountFailedException {
36+
throw new UnsupportedOperationException();
37+
}
38+
39+
/**
40+
* Unmounts (if required) and releases any resources.
41+
*
42+
* @throws UnmountFailedException Thrown if unmounting failed
43+
* @throws IOException Thrown if cleaning up resources failed
44+
*/
45+
default void close() throws UnmountFailedException, IOException {
46+
unmount();
47+
}
48+
49+
50+
}
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
package org.cryptomator.integrations.mount;
2+
3+
import org.jetbrains.annotations.Contract;
4+
import org.jetbrains.annotations.Range;
5+
6+
import java.nio.file.Path;
7+
8+
/**
9+
* Builder to mount a filesystem.
10+
* <p>
11+
* The setter may attempt to validate the input, but {@link #mount()} may still fail due to missing or invalid (combination of) options.
12+
* This holds especially for {@link MountBuilder#setMountFlags(String)};
13+
*/
14+
public interface MountBuilder {
15+
16+
/**
17+
* Sets the file system name.
18+
*
19+
* @param fileSystemName file system name
20+
* @return <code>this</code>
21+
* @throws UnsupportedOperationException If {@link MountCapability#FILE_SYSTEM_NAME} is not supported
22+
*/
23+
@Contract("_ -> this")
24+
default MountBuilder setFileSystemName(String fileSystemName) {
25+
throw new UnsupportedOperationException();
26+
}
27+
28+
/**
29+
* Use the given host name as the loopback address.
30+
*
31+
* @param hostName string conforming with the uri host part
32+
* @return <code>this</code>
33+
* @throws UnsupportedOperationException If {@link MountCapability#LOOPBACK_HOST_NAME} is not supported
34+
*/
35+
@Contract("_ -> this")
36+
default MountBuilder setLoopbackHostName(String hostName) {
37+
throw new UnsupportedOperationException();
38+
}
39+
40+
/**
41+
* Use the given TCP port of the loopback address.
42+
*
43+
* @param port Fixed TCP port or 0 to use a system-assigned port
44+
* @return <code>this</code>
45+
* @throws UnsupportedOperationException If {@link MountCapability#LOOPBACK_PORT} is not supported
46+
*/
47+
@Contract("_ -> this")
48+
default MountBuilder setLoopbackPort(@Range(from = 0, to = Short.MAX_VALUE) int port) {
49+
throw new UnsupportedOperationException();
50+
}
51+
52+
/**
53+
* Sets the mount point.
54+
* <p>
55+
* Unless the mount service provider supports {@link MountCapability#MOUNT_TO_SYSTEM_CHOSEN_PATH}, setting a mount point is required.
56+
*
57+
* @param mountPoint Where to mount the volume
58+
* @return <code>this</code>
59+
*/
60+
@Contract("_ -> this")
61+
default MountBuilder setMountpoint(Path mountPoint) {
62+
throw new UnsupportedOperationException();
63+
}
64+
65+
/**
66+
* Sets mount flags.
67+
*
68+
* @param mountFlags Mount flags
69+
* @return <code>this</code>
70+
* @throws UnsupportedOperationException If {@link MountCapability#MOUNT_FLAGS} is not supported
71+
* @see MountService#getDefaultMountFlags()
72+
*/
73+
@Contract("_ -> this")
74+
default MountBuilder setMountFlags(String mountFlags) {
75+
throw new UnsupportedOperationException();
76+
}
77+
78+
79+
/**
80+
* Instructs the mount to be read-only.
81+
*
82+
* @param mountReadOnly Whether to mount read-only.
83+
* @return <code>this</code>
84+
* @throws UnsupportedOperationException If {@link MountCapability#READ_ONLY} is not supported
85+
*/
86+
@Contract("_ -> this")
87+
default MountBuilder setReadOnly(boolean mountReadOnly) {
88+
throw new UnsupportedOperationException();
89+
}
90+
91+
/**
92+
* Sets a unique volume id.
93+
* <p>
94+
* The volume id is used as a path component, thus must conform with the os-dependent path component restrictions.
95+
*
96+
* @param volumeId String conforming with the os-dependent path component restrictions
97+
* @return <code>this</code>
98+
* @throws UnsupportedOperationException If {@link MountCapability#VOLUME_ID} is not supported
99+
*/
100+
@Contract("_ -> this")
101+
default MountBuilder setVolumeId(String volumeId) {
102+
throw new UnsupportedOperationException();
103+
}
104+
105+
/**
106+
* Sets a volume name.
107+
* <p>
108+
* The volume name is intended to be human-readable. The input string might be altered to replace non-conforming characters and thus is not suited to identify the volume.
109+
*
110+
* @param volumeName String conforming with the os-dependent naming restrictions
111+
* @return <code>this</code>
112+
* @throws UnsupportedOperationException If {@link MountCapability#VOLUME_NAME} is not supported
113+
*/
114+
@Contract("_ -> this")
115+
default MountBuilder setVolumeName(String volumeName) {
116+
throw new UnsupportedOperationException();
117+
}
118+
119+
/**
120+
* Mounts the file system.
121+
*
122+
* @return A mount handle
123+
* @throws MountFailedException If mounting failed
124+
*/
125+
@Contract(" -> new")
126+
Mount mount() throws MountFailedException;
127+
128+
}

0 commit comments

Comments
 (0)