protected Location.Name getRegion(final Path container) throws BackgroundException { return locationFeature.getLocation(container); } }
@Override public Set<Name> getLocations() { return delegate.getLocations(); }
@Override public Name getLocation(final Path file) throws BackgroundException { return delegate.getLocation(vault.encrypt(session, file)); }
@Override public Set<Name> getLocations() { return proxy.getLocations(); }
@Override public Name getLocation(final Path file) throws BackgroundException { return registry.find(session, file).getFeature(session, Location.class, proxy).getLocation(file); }
@Action public void createFolderButtonClicked(final ID sender) { final Location feature = pool.getFeature(Location.class); final FolderController sheet = new FolderController(this.getWorkdirFromSelection(), this.getSelectedPath(), cache, feature != null ? feature.getLocations() : Collections.emptySet(), new FolderController.Callback() { @Override public void callback(final Path folder, final String region) { background(new WorkerBackgroundAction<Path>(BrowserController.this, pool, new CreateDirectoryWorker(folder, region) { @Override public void cleanup(final Path folder) { reload(workdir(), Collections.singletonList(folder), Collections.singletonList(folder)); } })); } }); sheet.beginSheet(this); }
private AWSKMS client(final Path container) throws BackgroundException { final AWSKMSClientBuilder builder = AWSKMSClientBuilder.standard() .withCredentials(AWSCredentialsConfigurator.toAWSCredentialsProvider(bookmark.getCredentials())) .withClientConfiguration(configuration); final Location.Name region = locationFeature.getLocation(container); if(Location.unknown.equals(region)) { builder.withRegion(Regions.DEFAULT_REGION); } else { builder.withRegion(region.getIdentifier()); } return builder.build(); }
@Action public void createEncryptedVaultButtonClicked(final ID sender) { final Location feature = pool.getFeature(Location.class); final VaultController sheet = new VaultController(this.getWorkdirFromSelection(), this.getSelectedPath(), cache, feature != null ? feature.getLocations() : Collections.emptySet(), new VaultController.Callback() { @Override public void callback(final Path folder, final String region, final VaultCredentials passphrase) { background(new WorkerBackgroundAction<Path>(BrowserController.this, pool, new CreateVaultWorker(region, passphrase, PasswordStoreFactory.get(), VaultFactory.get(folder, DefaultVaultRegistry.DEFAULT_MASTERKEY_FILE_NAME, DefaultVaultRegistry.DEFAULT_PEPPER)) { @Override public void cleanup(final Path vault) { reload(workdir(), Collections.singletonList(folder), Collections.singletonList(folder)); } }) ); } }); sheet.beginSheet(this); }
final String location; if(!b.isLocationKnown()) { location = session.getFeature(Location.class).getLocation(bucket).getIdentifier();
@Override public void configure(final boolean enable, final Path file) throws BackgroundException { final Location.Name location = session.getFeature(Location.class).getLocation(file); if(Location.unknown.equals(location)) { throw new AccessDeniedException("Cannot read bucket location"); } final UDTProxyConfigurator configurator = new UDTProxyConfigurator(location, this.provider(), new KeychainX509TrustManager(new DefaultTrustManagerHostnameCallback(session.getHost())), new KeychainX509KeyManager(session.getHost())); configurator.configure(session); }
@Override public Void run(final Session<?> session) throws BackgroundException { if(session.getFeature(Location.class) != null) { location = session.getFeature(Location.class).getLocation(file);