@Override
    public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException {
        try {
            final AttributedList<Path> buckets = new AttributedList<Path>();
            final Ds3Client client = new SpectraClientBuilder().wrap(session.getClient(), session.getHost());
            final GetServiceResponse response = client.getService(new GetServiceRequest());
            for(final BucketDetails b : response.getListAllMyBucketsResult().getBuckets()) {
                final Path bucket = new Path(PathNormalizer.normalize(b.getName()), EnumSet.of(Path.Type.volume, Path.Type.directory));
                bucket.attributes().setCreationDate(b.getCreationDate().getTime());
                buckets.add(bucket);
            }
            return buckets;
        }
        catch(FailedRequestException e) {
            throw new SpectraExceptionMappingService().map("Listing directory {0} failed", e, directory);
        }
        catch(IOException e) {
            throw new DefaultIOExceptionMappingService().map("Listing directory {0} failed", e, directory);
        }
    }
@Test
    public void testList() throws Exception {
        new SpectraBucketListService(session).list(
                new Path(String.valueOf(Path.DELIMITER), EnumSet.of(Path.Type.volume, Path.Type.directory)), new DisabledListProgressListener());
    }