@Override
public boolean find(final Path file) throws BackgroundException {
final Vault vault = registry.find(session, file);
if(vault.equals(Vault.DISABLED)) {
if(autodetect) {
final Path directory = file.getParent();
final Path key = new Path(directory, DefaultVaultRegistry.DEFAULT_MASTERKEY_FILE_NAME, EnumSet.of(Path.Type.file));
if(proxy.withCache(cache).find(key)) {
if(log.isInfoEnabled()) {
log.info(String.format("Found master key %s", key));
}
try {
if(log.isInfoEnabled()) {
log.info(String.format("Found vault %s", directory));
}
return lookup.load(directory, DefaultVaultRegistry.DEFAULT_MASTERKEY_FILE_NAME, DefaultVaultRegistry.DEFAULT_PEPPER).getFeature(session, Find.class, proxy)
.withCache(cache)
.find(file);
}
catch(VaultUnlockCancelException e) {
}
}
}
}
return vault.getFeature(session, Find.class, proxy)
.withCache(cache)
.find(file);
}