@Override
    public Distribution read(final Path container, final Distribution.Method method, final LoginCallback prompt) throws BackgroundException {
        if(Distribution.WEBSITE.equals(method)) {
            try {
                final WebsiteConfig configuration = session.getClient().getWebsiteConfig(container.getName());
                final Distribution distribution = new Distribution(method, this.getOrigin(container, method),
                    configuration.isWebsiteConfigActive());
                distribution.setStatus(LocaleFactory.localizedString("Deployed", "S3"));
                // http://example-bucket.s3-website-us-east-1.amazonaws.com/
                distribution.setUrl(URI.create(String.format("%s://%s", method.getScheme(), this.getWebsiteHostname(container))));
                distribution.setIndexDocument(configuration.getIndexDocumentSuffix());
                distribution.setContainers(new S3BucketListService(session).list(
                    new Path(String.valueOf(Path.DELIMITER), EnumSet.of(Path.Type.volume, Path.Type.directory)), new DisabledListProgressListener()).toList());
                return distribution;
            }
            catch(ServiceException e) {
                // Not found. Website configuration not enabled.
                final Distribution distribution = new Distribution(method, this.getOrigin(container, method), false);
                distribution.setStatus(e.getErrorMessage());
                distribution.setUrl(URI.create(String.format("%s://%s", method.getScheme(), this.getWebsiteHostname(container))));
                return distribution;
            }
        }
        else {
            return super.read(container, method, prompt);
        }
    }
@Test
    public void testReadNoWebsiteConfiguration() throws Exception {
        final WebsiteCloudFrontDistributionConfiguration configuration
            = new WebsiteCloudFrontDistributionConfiguration(session, new S3LocationFeature(session), new DisabledX509TrustManager(), new DefaultX509KeyManager()
        );
        final Path container = new Path("test-eu-central-1-cyberduck", EnumSet.of(Path.Type.directory, Path.Type.volume));
        final Distribution distribution = configuration.read(container, Distribution.WEBSITE, new DisabledLoginCallback());
        assertEquals("The specified bucket does not have a website configuration", distribution.getStatus());
    }