@Override
    public LoggingConfiguration getConfiguration(final Path file) throws BackgroundException {
        final Path bucket = containerService.getContainer(file);
        if(file.getType().contains(Path.Type.upload)) {
            return LoggingConfiguration.empty();
        }
        try {
            final StorageBucketLoggingStatus status
                    = session.getClient().getBucketLoggingStatusImpl(bucket.isRoot() ? StringUtils.EMPTY : bucket.getName());
            if(null == status) {
                log.warn(String.format("Failure parsing logging status for %s", bucket));
                return LoggingConfiguration.empty();
            }
            final LoggingConfiguration configuration = new LoggingConfiguration(status.isLoggingEnabled(),
                    status.getTargetBucketName());
            if(bucket.isRoot()) {
                configuration.setContainers(Collections.singletonList(
                        new Path(RequestEntityRestStorageService.findBucketInHostname(session.getHost()), EnumSet.of(Path.Type.volume, Path.Type.directory)))
                );
            }
            else {
                try {
                    configuration.setContainers(new S3BucketListService(session).list(Home.ROOT, new DisabledListProgressListener()).toList());
                }
                catch(AccessDeniedException | InteroperabilityException e) {
                    log.warn(String.format("Failure listing buckets. %s", e.getMessage()));
                    configuration.setContainers(Collections.singletonList(bucket));
                }
            }
            return configuration;
        }
        catch(ServiceException e) {
            try {
                throw new S3ExceptionMappingService().map("Failure to read attributes of {0}", e, file);
            }
            catch(AccessDeniedException | InteroperabilityException l) {
                log.warn(String.format("Missing permission to read logging configuration for %s %s", bucket.getName(), e.getMessage()));
                return LoggingConfiguration.empty();
            }
        }
    }
@Test(expected = NotfoundException.class)
    public void testReadNotFound() throws Exception {
        new S3LoggingFeature(session).getConfiguration(
            new Path(UUID.randomUUID().toString(), EnumSet.of(Path.Type.directory))
        );
    }