@Test public void testAccessPathStyleBucketEuCentral() throws Exception { final S3Session session = new S3Session( new Host(new S3Protocol(), new S3Protocol().getDefaultHostname(), new Credentials( System.getProperties().getProperty("s3.key"), System.getProperties().getProperty("s3.secret") ))) { @Override public S3Protocol.AuthenticationHeaderSignatureVersion getSignatureVersion() { return S3Protocol.AuthenticationHeaderSignatureVersion.AWS4HMACSHA256; } @Override public RequestEntityRestStorageService connect(final Proxy proxy, final HostKeyCallback hostkey, final LoginCallback prompt) { final RequestEntityRestStorageService client = super.connect(proxy, hostkey, prompt); client.getConfiguration().setProperty("s3service.disable-dns-buckets", String.valueOf(true)); return client; } }; assertNotNull(session.open(Proxy.DIRECT, new DisabledHostKeyCallback(), new DisabledLoginCallback())); session.login(Proxy.DIRECT, new DisabledLoginCallback(), new DisabledCancelCallback()); assertEquals(new S3LocationFeature.S3Region("eu-central-1"), new S3LocationFeature(session).getLocation( new Path("test-eu-central-1-cyberduck", EnumSet.of(Path.Type.directory)) )); session.close(); }
@Override public Name getLocation(final Path file) throws BackgroundException { final Path bucket = containerService.getContainer(file); if(bucket.isRoot()) { return unknown; } return this.getLocation(bucket.getName()); }
S3LocationFeature implements Location { @Override public Name getLocation(final Path file) throws BackgroundException { final Path bucket = containerService.getContainer(file); if(bucket.isRoot()) { return unknown; } return this.getLocation(bucket.getName()); } }
S3LocationFeature implements Location { @Override public Name getLocation(final Path file) throws BackgroundException { final Path bucket = containerService.getContainer(file); if(bucket.isRoot()) { return unknown; } return this.getLocation(bucket.getName()); } S3LocationFeature(final S3Session session);  S3LocationFeature(final S3Session session, final RegionEndpointCache cache); }
S3LocationFeature implements Location { @Override public Name getLocation(final Path file) throws BackgroundException { final Path bucket = containerService.getContainer(file); if(bucket.isRoot()) { return unknown; } return this.getLocation(bucket.getName()); } S3LocationFeature(final S3Session session);  S3LocationFeature(final S3Session session, final RegionEndpointCache cache); @Override Set<Name> getLocations(); @Override Name getLocation(final Path file); }
S3LocationFeature implements Location { @Override public Name getLocation(final Path file) throws BackgroundException { final Path bucket = containerService.getContainer(file); if(bucket.isRoot()) { return unknown; } return this.getLocation(bucket.getName()); } S3LocationFeature(final S3Session session);  S3LocationFeature(final S3Session session, final RegionEndpointCache cache); @Override Set<Name> getLocations(); @Override Name getLocation(final Path file);  }