@Override
    public Acl getPermission(final Path file) throws BackgroundException {
        try {
            final Acl acl = new Acl();
            if(containerService.isContainer(file)) {
                final BucketAccessControls controls = session.getClient().bucketAccessControls().list(
                        containerService.getContainer(file).getName()).execute();
                for(BucketAccessControl control : controls.getItems()) {
                    final String entity = control.getEntity();
                    acl.addAll(this.toUser(entity, control.getEmail()), new Acl.Role(control.getRole()));
                }
            }
            else {
                final ObjectAccessControls controls = session.getClient().objectAccessControls().list(containerService.getContainer(file).getName(), containerService.getKey(file)).execute();
                for(ObjectAccessControl control : controls.getItems()) {
                    final String entity = control.getEntity();
                    acl.addAll(this.toUser(entity, control.getEmail()), this.toRole(control));
                }
            }
            return acl;
        }
        catch(IOException e) {
            final BackgroundException failure = new GoogleStorageExceptionMappingService().map("Failure to read attributes of {0}", e, file);
            if(file.isDirectory()) {
                if(failure instanceof NotfoundException) {
                    // No placeholder file may exist but we just have a common prefix
                    return Acl.EMPTY;
                }
            }
            if(failure instanceof InteroperabilityException) {
                // The specified method is not allowed against this resource. The case for delete markers in versioned buckets.
                return Acl.EMPTY;
            }
            throw failure;
        }
    }
@Test(expected = NotfoundException.class)
    public void testReadNotFound() throws Exception {
        final Path container = new Path("cyberduck-test-eu", EnumSet.of(Path.Type.directory));
        final Path test = new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
        final GoogleStorageAccessControlListFeature f = new GoogleStorageAccessControlListFeature(session);
        f.getPermission(test);
    }