@Override
    public Name getLocation(final Path file) throws BackgroundException {
        if(StringUtils.isNotBlank(session.getHost().getRegion())) {
            return new S3Region(session.getHost().getRegion());
        }
        final Path bucket = containerService.getContainer(file);
        return this.getLocation(bucket.isRoot() ? StringUtils.EMPTY : bucket.getName());
    }
@Test
    public void testAccessPathStyleBucketEuCentral() throws Exception {
        final Host host = new Host(new S3Protocol(), new S3Protocol().getDefaultHostname(), new Credentials(
                PROPERTIES.get("s3.key"), PROPERTIES.get("s3.secret")
        )) {
            @Override
            public String getProperty(final String key) {
                if("s3.bucket.virtualhost.disable".equals(key)) {
                    return String.valueOf(true);
                }
                return super.getProperty(key);
            }
        };
        final S3Session session = new S3Session(host);
        assertNotNull(session.open(new DisabledProxyFinder(), new DisabledHostKeyCallback(), new DisabledLoginCallback(), new DisabledCancelCallback()));
        session.login(new DisabledLoginCallback(), new DisabledCancelCallback());
        final RegionEndpointCache cache = session.getClient().getRegionEndpointCache();
        assertEquals(new S3LocationFeature.S3Region("eu-central-1"), new S3LocationFeature(session, cache).getLocation(
                new Path("test-eu-central-1-cyberduck", EnumSet.of(Path.Type.directory))
        ));
        assertEquals("eu-central-1", cache.getRegionForBucketName("test-eu-central-1-cyberduck"));
        session.close();
    }