Skip to content

Commit

Permalink
added jetbrains annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
overheadhunter committed Mar 7, 2022
1 parent de302ae commit 70fb01c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@
</license>
</licenses>

<dependencies>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>23.0.0</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@


module org.cryptomator.integrations.api {
requires static org.jetbrains.annotations;

exports org.cryptomator.integrations.autostart;
exports org.cryptomator.integrations.keychain;
exports org.cryptomator.integrations.tray;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.cryptomator.integrations.autostart;

import org.cryptomator.integrations.common.IntegrationsLoader;
import org.jetbrains.annotations.Blocking;

import java.util.Optional;

Expand All @@ -16,8 +17,10 @@ static Optional<AutoStartProvider> get() {
return IntegrationsLoader.load(AutoStartProvider.class);
}

@Blocking
void enable() throws ToggleAutoStartFailedException;

@Blocking
void disable() throws ToggleAutoStartFailedException;

boolean isEnabled();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package org.cryptomator.integrations.keychain;

import org.cryptomator.integrations.common.IntegrationsLoader;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Blocking;
import org.jetbrains.annotations.Nls;

import java.util.stream.Stream;

Expand All @@ -24,6 +27,7 @@ static Stream<KeychainAccessProvider> get() {
*
* @return user-friendly name (must not be null or empty)
*/
@Nls(capitalization = Nls.Capitalization.Title)
String displayName();

/**
Expand All @@ -35,6 +39,7 @@ static Stream<KeychainAccessProvider> get() {
* @deprecated Please use {@link #storePassphrase(String, String, CharSequence)} instead
*/
@Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "1.2.0")
void storePassphrase(String key, CharSequence passphrase) throws KeychainAccessException;

/**
Expand All @@ -47,6 +52,7 @@ static Stream<KeychainAccessProvider> get() {
* @param passphrase The secret to store in this keychain.
* @throws KeychainAccessException If storing the password failed
*/
@Blocking
default void storePassphrase(String key, String displayName, CharSequence passphrase) throws KeychainAccessException {
storePassphrase(key, passphrase);
}
Expand All @@ -56,6 +62,7 @@ default void storePassphrase(String key, String displayName, CharSequence passph
* @return The stored passphrase for the given key or <code>null</code> if no value for the given key could be found.
* @throws KeychainAccessException If loading the password failed
*/
@Blocking
char[] loadPassphrase(String key) throws KeychainAccessException;

/**
Expand All @@ -75,6 +82,7 @@ default void storePassphrase(String key, String displayName, CharSequence passph
* @deprecated Please use {@link #changePassphrase(String, String, CharSequence)} instead
*/
@Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "1.2.0")
void changePassphrase(String key, CharSequence passphrase) throws KeychainAccessException;

/**
Expand All @@ -87,6 +95,7 @@ default void storePassphrase(String key, String displayName, CharSequence passph
* @param passphrase The secret to be updated in this keychain.
* @throws KeychainAccessException If changing the password failed
*/
@Blocking
default void changePassphrase(String key, String displayName, CharSequence passphrase) throws KeychainAccessException {
changePassphrase(key, passphrase);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.cryptomator.integrations.tray;

import org.cryptomator.integrations.common.IntegrationsLoader;
import org.jetbrains.annotations.ApiStatus;

import java.io.IOException;
import java.io.InputStream;
Expand All @@ -12,6 +13,7 @@
*
* @since 1.1.0
*/
@ApiStatus.Experimental
public interface TrayMenuController {

static Optional<TrayMenuController> get() {
Expand Down

0 comments on commit 70fb01c

Please sign in to comment.