Skip to content

Commit

Permalink
Fix #10214.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkocher committed Feb 2, 2018
1 parent 12c4320 commit 239c36b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.
Expand Up @@ -40,9 +40,6 @@ public class DefaultVaultRegistry extends CopyOnWriteArraySet<Vault> implements
private final PasswordStore keychain;
private final PasswordCallback prompt;

private boolean autodetect = preferences.getBoolean("cryptomator.vault.autodetect")
&& preferences.getBoolean("cryptomator.enable");

public DefaultVaultRegistry(final PasswordCallback prompt) {
this(PasswordStoreFactory.get(), prompt);
}
Expand Down Expand Up @@ -119,11 +116,15 @@ public <T> T getFeature(final Session<?> session, final Class<T> type, final T p
}
if(type == ListService.class) {
return (T) new VaultRegistryListService(session, (ListService) proxy, this,
new LoadingVaultLookupListener(session, this, keychain, prompt)).withAutodetect(autodetect);
new LoadingVaultLookupListener(session, this, keychain, prompt))
.withAutodetect(preferences.getBoolean("cryptomator.vault.autodetect")
);
}
if(type == Find.class) {
return (T) new VaultRegistryFindFeature(session, (Find) proxy, this,
new LoadingVaultLookupListener(session, this, keychain, prompt)).withAutodetect(autodetect);
new LoadingVaultLookupListener(session, this, keychain, prompt))
.withAutodetect(preferences.getBoolean("cryptomator.vault.autodetect")
);
}
if(type == Bulk.class) {
return (T) new VaultRegistryBulkFeature(session, (Bulk) proxy, this);
Expand Down Expand Up @@ -214,10 +215,4 @@ public <T> T getFeature(final Session<?> session, final Class<T> type, final T p
}
return proxy;
}

@Override
public DefaultVaultRegistry withAutodetect(final boolean autodetect) {
this.autodetect = autodetect && preferences.getBoolean("cryptomator.enable");
return this;
}
}
Expand Up @@ -41,11 +41,6 @@ public boolean contains(final Path vault) {
return false;
}

@Override
public VaultRegistry withAutodetect(final boolean autodetect) {
return this;
}

@Override
public boolean add(final Vault vault) {
return false;
Expand Down
2 changes: 0 additions & 2 deletions core/src/main/java/ch/cyberduck/core/vault/VaultRegistry.java
Expand Up @@ -41,6 +41,4 @@ public interface VaultRegistry {
<T> T getFeature(Session<?> session, Class<T> type, T proxy);

boolean contains(Path vault);

VaultRegistry withAutodetect(boolean autodetect);
}

0 comments on commit 239c36b

Please sign in to comment.