@Override
    public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException {
        try {
            final AttributedList<Path> buckets = new AttributedList<Path>();
            for(B2BucketResponse bucket : session.getClient().listBuckets()) {
                buckets.add(new Path(PathNormalizer.normalize(bucket.getBucketName()), EnumSet.of(Path.Type.directory, Path.Type.volume),
                        new B2AttributesFinderFeature(session, fileid).toAttributes(bucket)));
            }
            listener.chunk(directory, buckets);
            return buckets;
        }
        catch(B2ApiException e) {
            throw new B2ExceptionMappingService(fileid).map("Listing directory {0} failed", e, directory);
        }
        catch(IOException e) {
            throw new DefaultIOExceptionMappingService().map(e);
        }
    }
@Test
    @Ignore
    public void testList() throws Exception {
        final B2VersionIdProvider fileid = new B2VersionIdProvider(session);
        final AttributedList<Path> list = new B2BucketListService(session, fileid).list(
                new Path(String.valueOf(Path.DELIMITER), EnumSet.of(Path.Type.volume, Path.Type.directory)), new DisabledListProgressListener());
        assertFalse(list.isEmpty());
        for(Path bucket : list) {
            assertEquals(bucket.attributes(), new B2AttributesFinderFeature(session, fileid).find(bucket, new DisabledListProgressListener()));
        }
    }