@Test public void testReadNoConfiguredDistributionForOrigin() throws Exception { final Host origin = new Host(new TestProtocol(), "myhost.localdomain"); origin.getCdnCredentials().setUsername(System.getProperties().getProperty("s3.key")); origin.getCdnCredentials().setPassword(System.getProperties().getProperty("s3.secret")); final CustomOriginCloudFrontDistributionConfiguration configuration = new CustomOriginCloudFrontDistributionConfiguration(origin, new DefaultX509TrustManager() { @Override public void checkServerTrusted(final X509Certificate[] certs, final String cipher) { } }, new DefaultX509KeyManager()); final Path container = new Path("unknown.cyberduck.ch", EnumSet.of(Path.Type.directory, Path.Type.volume)); assertFalse(configuration.read(container, Distribution.CUSTOM, new DisabledLoginCallback() { @Override public Credentials prompt(final Host bookmark, final String username, final String title, final String reason, final LoginOptions options) { return new Credentials(System.getProperties().getProperty("s3.key"), System.getProperties().getProperty("s3.secret")); } }).isEnabled()); }
@Override public Distribution read(final Path file, final Distribution.Method method, final LoginCallback prompt) throws BackgroundException { final Distribution distribution = this.connected(new Connected<Distribution>() { @Override public Distribution call() throws BackgroundException { return CustomOriginCloudFrontDistributionConfiguration.super.read(file, method, prompt); } }, prompt); cache.put(containerService.getContainer(file), distribution); return distribution; }
CustomOriginCloudFrontDistributionConfiguration extends CloudFrontDistributionConfiguration { @Override public Distribution read(final Path file, final Distribution.Method method, final LoginCallback prompt) throws BackgroundException { final Distribution distribution = this.connected(new Connected<Distribution>() { @Override public Distribution call() throws BackgroundException { return CustomOriginCloudFrontDistributionConfiguration.super.read(file, method, prompt); } }, prompt); cache.put(containerService.getContainer(file), distribution); return distribution; } }
CustomOriginCloudFrontDistributionConfiguration extends CloudFrontDistributionConfiguration { @Override public Distribution read(final Path file, final Distribution.Method method, final LoginCallback prompt) throws BackgroundException { final Distribution distribution = this.connected(new Connected<Distribution>() { @Override public Distribution call() throws BackgroundException { return CustomOriginCloudFrontDistributionConfiguration.super.read(file, method, prompt); } }, prompt); cache.put(containerService.getContainer(file), distribution); return distribution; } CustomOriginCloudFrontDistributionConfiguration(final Host origin,
                                                           final X509TrustManager trust,
                                                           final X509KeyManager key); }
CustomOriginCloudFrontDistributionConfiguration extends CloudFrontDistributionConfiguration { @Override public Distribution read(final Path file, final Distribution.Method method, final LoginCallback prompt) throws BackgroundException { final Distribution distribution = this.connected(new Connected<Distribution>() { @Override public Distribution call() throws BackgroundException { return CustomOriginCloudFrontDistributionConfiguration.super.read(file, method, prompt); } }, prompt); cache.put(containerService.getContainer(file), distribution); return distribution; } CustomOriginCloudFrontDistributionConfiguration(final Host origin,
                                                           final X509TrustManager trust,
                                                           final X509KeyManager key); @Override Distribution read(final Path file, final Distribution.Method method, final LoginCallback prompt); @Override void write(final Path file, final Distribution distribution, final LoginCallback prompt); @Override List<Distribution.Method> getMethods(final Path container); @Override DescriptiveUrlBag toUrl(final Path file); }
CustomOriginCloudFrontDistributionConfiguration extends CloudFrontDistributionConfiguration { @Override public Distribution read(final Path file, final Distribution.Method method, final LoginCallback prompt) throws BackgroundException { final Distribution distribution = this.connected(new Connected<Distribution>() { @Override public Distribution call() throws BackgroundException { return CustomOriginCloudFrontDistributionConfiguration.super.read(file, method, prompt); } }, prompt); cache.put(containerService.getContainer(file), distribution); return distribution; } CustomOriginCloudFrontDistributionConfiguration(final Host origin,
                                                           final X509TrustManager trust,
                                                           final X509KeyManager key); @Override Distribution read(final Path file, final Distribution.Method method, final LoginCallback prompt); @Override void write(final Path file, final Distribution distribution, final LoginCallback prompt); @Override List<Distribution.Method> getMethods(final Path container); @Override DescriptiveUrlBag toUrl(final Path file);  }