@Override
    public List<Distribution.Method> getMethods(final Path file) {
        if(!ServiceUtils.isBucketNameValidDNSName(containerService.getContainer(file).getName())) {
            // Disable website configuration if bucket name is not DNS compatible
            return super.getMethods(file);
        }
        final List<Distribution.Method> methods = new ArrayList<>();
        if(S3Session.isAwsHostname(session.getHost().getHostname())) {
            methods.addAll(super.getMethods(file));
            methods.addAll(Arrays.asList(Distribution.WEBSITE, Distribution.WEBSITE_CDN));
        }
        else {
            // Only allow website configuration for non AWS endpoints.
            methods.add(Distribution.WEBSITE);
        }
        return methods;
    }
@Test
    public void testGetMethodsNonAWS() {
        final S3Session session = new S3Session(new Host(new S3Protocol(), "s3.cyberduck.io"));
        final WebsiteCloudFrontDistributionConfiguration configuration = new WebsiteCloudFrontDistributionConfiguration(session, new S3LocationFeature(session), new DisabledX509TrustManager(), new DefaultX509KeyManager()
        );
        assertFalse(configuration.getMethods(
            new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.DOWNLOAD));
        assertFalse(configuration.getMethods(
            new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.STREAMING));
        assertFalse(configuration.getMethods(
            new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.CUSTOM));
        assertFalse(configuration.getMethods(
            new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.WEBSITE_CDN));
        assertTrue(configuration.getMethods(
            new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.WEBSITE));
        assertFalse(configuration.getMethods(
            new Path(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)), "bbb_b", EnumSet.of(Path.Type.directory, Path.Type.volume))).contains(Distribution.WEBSITE));
    }