@Override
    public LifecycleConfiguration getConfiguration(final Path file) throws BackgroundException {
        final Path container = containerService.getContainer(file);
        if(container.isRoot()) {
            return LifecycleConfiguration.empty();
        }
        try {
            final Storage.Buckets.Get request = session.getClient().buckets().get(container.getName());
            if(containerService.getContainer(file).attributes().getCustom().containsKey(GoogleStorageAttributesFinderFeature.KEY_REQUESTER_PAYS)) {
                request.setUserProject(session.getHost().getCredentials().getUsername());
            }
            final Bucket.Lifecycle status = request.execute().getLifecycle();
            if(null != status) {
                Integer transition = null;
                Integer expiration = null;
                for(Bucket.Lifecycle.Rule rule : status.getRule()) {
                    if("SetStorageClass".equals(rule.getAction().getType())) {
                        transition = rule.getCondition().getAge();
                    }
                    if("Delete".equals(rule.getAction().getType())) {
                        expiration = rule.getCondition().getAge();
                    }
                }
                return new LifecycleConfiguration(transition, expiration);
            }
            return LifecycleConfiguration.empty();
        }
        catch(IOException e) {
            try {
                throw new GoogleStorageExceptionMappingService().map("Failure to read attributes of {0}", e, container);
            }
            catch(AccessDeniedException | InteroperabilityException l) {
                log.warn(String.format("Missing permission to read lifecycle configuration for %s %s", container, e.getMessage()));
                return LifecycleConfiguration.empty();
            }
        }
    }
@Test
    public void testGetConfigurationAccessDenied() throws Exception {
        assertEquals(LifecycleConfiguration.empty(), new GoogleStorageLifecycleFeature(session).getConfiguration(
                new Path("bucket", EnumSet.of(Path.Type.directory))
        ));
    }