@Override
    public VersioningConfiguration getConfiguration(final Path file) throws BackgroundException {
        final Path bucket = containerService.getContainer(file);
        if(cache.contains(bucket)) {
            return cache.get(bucket);
        }
        try {
            final S3BucketVersioningStatus status
                    = session.getClient().getBucketVersioningStatus(bucket.isRoot() ? StringUtils.EMPTY : bucket.getName());
            if(null == status) {
                log.warn(String.format("Failure parsing versioning status for %s", bucket));
                return VersioningConfiguration.empty();
            }
            final VersioningConfiguration configuration = new VersioningConfiguration(status.isVersioningEnabled(),
                    status.isMultiFactorAuthDeleteRequired());
            cache.put(bucket, configuration);
            return configuration;
        }
        catch(ServiceException e) {
            try {
                throw new S3ExceptionMappingService().map("Cannot read container configuration", e);
            }
            catch(AccessDeniedException l) {
                log.warn(String.format("Missing permission to read versioning configuration for %s %s", bucket, e.getMessage()));
                return VersioningConfiguration.empty();
            }
            catch(InteroperabilityException | NotfoundException i) {
                log.warn(String.format("Not supported to read versioning configuration for %s %s", bucket, e.getMessage()));
                return VersioningConfiguration.empty();
            }
        }
    }
@Test
    public void testGetConfigurationEnabled() throws Exception {
        final VersioningConfiguration configuration
                = new S3VersioningFeature(session, new S3AccessControlListFeature(session)).getConfiguration(new Path("versioning-test-eu-central-1-cyberduck", EnumSet.of(Path.Type.directory, Path.Type.volume)));
        assertNotNull(configuration);
        assertTrue(configuration.isEnabled());
    }