@Override
    public void delete(final Map<Path, TransferStatus> files, final PasswordCallback prompt, final Callback callback) throws BackgroundException {
        for(Path file : files.keySet()) {
            try {
                callback.delete(file);
                if(containerService.isContainer(file)) {
                    final Storage.Buckets.Delete request = session.getClient().buckets().delete(file.getName());
                    if(containerService.getContainer(file).attributes().getCustom().containsKey(GoogleStorageAttributesFinderFeature.KEY_REQUESTER_PAYS)) {
                        request.setUserProject(session.getHost().getCredentials().getUsername());
                    }
                    request.execute();
                }
                else {
                    final Storage.Objects.Delete request = session.getClient().objects().delete(containerService.getContainer(file).getName(), containerService.getKey(file));
                    if(containerService.getContainer(file).attributes().getCustom().containsKey(GoogleStorageAttributesFinderFeature.KEY_REQUESTER_PAYS)) {
                        request.setUserProject(session.getHost().getCredentials().getUsername());
                    }
                    final VersioningConfiguration versioning = null != session.getFeature(Versioning.class) ? session.getFeature(Versioning.class).getConfiguration(
                            containerService.getContainer(file)
                    ) : VersioningConfiguration.empty();
                    if(versioning.isEnabled()) {
                        if(StringUtils.isNotBlank(file.attributes().getVersionId())) {
                            // You permanently delete versions of objects by including the generation number in the deletion request
                            request.setGeneration(Long.parseLong(file.attributes().getVersionId()));
                        }
                    }
                    request.execute();
                }
            }
            catch(IOException e) {
                final BackgroundException failure = new GoogleStorageExceptionMappingService().map("Cannot delete {0}", e, file);
                if(file.isDirectory()) {
                    if(failure instanceof NotfoundException) {
                        // No placeholder file may exist but we just have a common prefix
                        continue;
                    }
                }
                throw failure;
            }
        }
    }
@Test
    public void testDeleteContainer() throws Exception {
        final Path container = new Path(new AsciiRandomStringService().random().toLowerCase(Locale.ROOT), EnumSet.of(Path.Type.volume, Path.Type.directory));
        new GoogleStorageDirectoryFeature(session).mkdir(container, new TransferStatus().withRegion("us"));
        assertTrue(new GoogleStorageFindFeature(session).find(container));
        new GoogleStorageDeleteFeature(session).delete(Collections.singletonList(container), new DisabledLoginCallback(), new Delete.DisabledCallback());
        assertFalse(new GoogleStorageFindFeature(session).find(container));
    }