@Override
    public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException {
        return this.list(directory, listener, String.valueOf(Path.DELIMITER));
    }
@Test
    public void testDetermineCorrectRegionFrom400Reply() throws Exception {
        final Path bucket = new Path(new DefaultHomeFinderService(session).find(), new AsciiRandomStringService(30).random(), EnumSet.of(Path.Type.directory, Path.Type.volume));
        final S3AccessControlListFeature acl = new S3AccessControlListFeature(session);
        final S3DirectoryFeature feature = new S3DirectoryFeature(session, new S3WriteFeature(session, acl), acl);
        feature.mkdir(bucket, new TransferStatus().withRegion("eu-central-1"));
        // Populate incorrect region in cache
        final RegionEndpointCache cache = session.getClient().getRegionEndpointCache();
        assertEquals("eu-central-1", cache.getRegionForBucketName(bucket.getName()));
        cache.putRegionForBucketName(bucket.getName(), "eu-west-1");
        assertNotSame(AttributedList.emptyList(), new S3ObjectListService(session, acl).list(bucket, new DisabledListProgressListener()));
        assertEquals("eu-central-1", cache.getRegionForBucketName(bucket.getName()));
        assertFalse(session.getClient().getConfiguration().getBoolProperty("s3service.disable-dns-buckets", true));
        new S3DefaultDeleteFeature(session).delete(Collections.singletonList(bucket), new DisabledLoginCallback(), new Delete.DisabledCallback());
    }