Skip to content

Commit 4e67c36

Browse files
committed
use new name QuickAccess
1 parent f43238a commit 4e67c36

File tree

6 files changed

+22
-23
lines changed

6 files changed

+22
-23
lines changed

pom.xml

Lines changed: 2 additions & 2 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-linux</artifactId>
8-
<version>1.5.0-SNAPSHOT</version>
8+
<version>1.5.0-quickaccess</version>
99

1010
<name>integrations-linux</name>
1111
<description>Provides optional Linux services used by Cryptomator</description>
@@ -40,7 +40,7 @@
4040

4141
<!-- runtime dependencies -->
4242

43-
<api.version>1.4.0-sidebar</api.version>
43+
<api.version>1.4.0-quickaccess</api.version>
4444
<secret-service.version>2.0.1-alpha</secret-service.version>
4545
<kdewallet.version>1.4.0</kdewallet.version>
4646
<slf4j.version>2.0.13</slf4j.version>

src/main/java/module-info.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import org.cryptomator.integrations.sidebar.SidebarService;
21
import org.cryptomator.integrations.keychain.KeychainAccessProvider;
2+
import org.cryptomator.integrations.quickaccess.QuickAccessService;
33
import org.cryptomator.integrations.revealpath.RevealPathService;
44
import org.cryptomator.integrations.tray.TrayMenuController;
5-
import org.cryptomator.linux.sidebar.NautilusSidebarService;
65
import org.cryptomator.linux.keychain.KDEWalletKeychainAccess;
76
import org.cryptomator.linux.keychain.SecretServiceKeychainAccess;
7+
import org.cryptomator.linux.quickaccess.NautilusBookmarks;
88
import org.cryptomator.linux.revealpath.DBusSendRevealPathService;
99
import org.cryptomator.linux.tray.AppindicatorTrayMenuController;
1010

@@ -19,7 +19,7 @@
1919
provides KeychainAccessProvider with SecretServiceKeychainAccess, KDEWalletKeychainAccess;
2020
provides RevealPathService with DBusSendRevealPathService;
2121
provides TrayMenuController with AppindicatorTrayMenuController;
22-
provides SidebarService with NautilusSidebarService;
22+
provides QuickAccessService with NautilusBookmarks;
2323

2424
opens org.cryptomator.linux.tray to org.cryptomator.integrations.api;
2525
}

src/main/java/org/cryptomator/linux/sidebar/NautilusSidebarService.java renamed to src/main/java/org/cryptomator/linux/quickaccess/NautilusBookmarks.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package org.cryptomator.linux.sidebar;
1+
package org.cryptomator.linux.quickaccess;
22

33
import org.cryptomator.integrations.common.CheckAvailability;
44
import org.cryptomator.integrations.common.Priority;
5-
import org.cryptomator.integrations.sidebar.SidebarService;
6-
import org.cryptomator.integrations.sidebar.SidebarServiceException;
5+
import org.cryptomator.integrations.quickaccess.QuickAccessService;
6+
import org.cryptomator.integrations.quickaccess.QuickAccessServiceException;
77

88
import java.io.IOException;
99
import java.nio.charset.StandardCharsets;
@@ -17,15 +17,15 @@
1717

1818
@Priority(100)
1919
@CheckAvailability
20-
public class NautilusSidebarService implements SidebarService {
20+
public class NautilusBookmarks implements QuickAccessService {
2121

2222
private static final int MAX_FILE_SIZE = 4096;
2323
private static final Path BOOKMARKS_FILE = Path.of(System.getProperty("user.home"), ".config/gtk-3.0/bookmarks");
2424
private static final Path TMP_FILE = BOOKMARKS_FILE.resolveSibling("bookmarks.cryptomator.tmp");
2525
private static final Lock BOOKMARKS_LOCK = new ReentrantReadWriteLock().writeLock();
2626

2727
@Override
28-
public SidebarEntry add(Path target, String displayName) throws SidebarServiceException {
28+
public QuickAccessService.QuickAccessEntry add(Path target, String displayName) throws QuickAccessServiceException {
2929
String entryLine = "file://" + target.toAbsolutePath() + " " + displayName;
3030
try {
3131
BOOKMARKS_LOCK.lock();
@@ -37,25 +37,25 @@ public SidebarEntry add(Path target, String displayName) throws SidebarServiceEx
3737
entries.add(entryLine);
3838
Files.write(TMP_FILE, entries, StandardCharsets.UTF_8, StandardOpenOption.WRITE, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING);
3939
Files.move(TMP_FILE, BOOKMARKS_FILE, StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.ATOMIC_MOVE);
40-
return new NautilusSidebarEntry(entryLine);
40+
return new NautilusQuickAccessEntry(entryLine);
4141
} catch (IOException e) {
42-
throw new SidebarServiceException("Adding entry to Nautilus bookmarks file failed.", e);
42+
throw new QuickAccessServiceException("Adding entry to Nautilus bookmarks file failed.", e);
4343
} finally {
4444
BOOKMARKS_LOCK.unlock();
4545
}
4646
}
4747

48-
static class NautilusSidebarEntry implements SidebarEntry {
48+
static class NautilusQuickAccessEntry implements QuickAccessEntry {
4949

5050
private final String line;
5151
private volatile boolean isRemoved = false;
5252

53-
NautilusSidebarEntry(String line) {
53+
NautilusQuickAccessEntry(String line) {
5454
this.line = line;
5555
}
5656

5757
@Override
58-
public void remove() throws SidebarServiceException {
58+
public void remove() throws QuickAccessServiceException {
5959
try {
6060
BOOKMARKS_LOCK.lock();
6161
if (isRemoved) {
@@ -71,7 +71,7 @@ public void remove() throws SidebarServiceException {
7171
}
7272
isRemoved = true;
7373
} catch (IOException e) {
74-
throw new SidebarServiceException("Removing entry from Nautilus bookmarks file failed", e);
74+
throw new QuickAccessServiceException("Removing entry from Nautilus bookmarks file failed", e);
7575
} finally {
7676
BOOKMARKS_LOCK.unlock();
7777
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.cryptomator.linux.quickaccess.NautilusSidebarService

src/main/resources/META-INF/services/org.cryptomator.integrations.sidebar.SidebarService

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/test/java/org/cryptomator/linux/filemanagersidebar/NautilusSidebarServiceIT.java renamed to src/test/java/org/cryptomator/linux/quickaccess/NautilusBookmarksIT.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
package org.cryptomator.linux.filemanagersidebar;
1+
package org.cryptomator.linux.quickaccess;
22

3-
import org.cryptomator.integrations.sidebar.SidebarServiceException;
4-
import org.cryptomator.linux.sidebar.NautilusSidebarService;
3+
import org.cryptomator.integrations.quickaccess.QuickAccessServiceException;
54
import org.junit.jupiter.api.Disabled;
65
import org.junit.jupiter.api.DisplayName;
76
import org.junit.jupiter.api.Test;
@@ -10,13 +9,13 @@
109
import java.nio.file.Path;
1110
import java.time.Duration;
1211

13-
public class NautilusSidebarServiceIT {
12+
public class NautilusBookmarksIT {
1413

1514
@Test
1615
@DisplayName("Adds for 20s an entryto the Nautilus sidebar")
1716
@Disabled
18-
public void testSidebarIntegration(@TempDir Path tmpdir) throws SidebarServiceException, InterruptedException {
19-
var entry = new NautilusSidebarService().add(tmpdir, "integrations-linux");
17+
public void testSidebarIntegration(@TempDir Path tmpdir) throws QuickAccessServiceException, InterruptedException {
18+
var entry = new NautilusBookmarks().add(tmpdir, "integrations-linux");
2019
Thread.sleep(Duration.ofSeconds(20));
2120
entry.remove();
2221
}

0 commit comments

Comments
 (0)