@Override
    public Distribution read(final Path file, final Distribution.Method method, final LoginCallback prompt) throws BackgroundException {
        return this.connected(new Connected<Distribution>() {
            @Override
            public Distribution call() throws BackgroundException {
                return CustomOriginCloudFrontDistributionConfiguration.super.read(file, method, prompt);
            }
        }, prompt);
    }
@Test
    public void testReadNoConfiguredDistributionForOrigin() throws Exception {
        final Host origin = new Host(new TestProtocol(), "myhost.localdomain");
        origin.getCdnCredentials().setUsername(PROPERTIES.get("s3.key"));
        origin.getCdnCredentials().setPassword(PROPERTIES.get("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));
        final Distribution distribution = 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(PROPERTIES.get("s3.key"), PROPERTIES.get("s3.secret"));
            }
        });
        assertFalse(distribution.isEnabled());
        assertEquals("Amazon CloudFront", distribution.getName());
    }