@Test public void testGetLocation() throws Exception { final S3LocationFeature feature = new S3LocationFeature(session); assertEquals(new S3LocationFeature.S3Region("eu-west-1"), feature.getLocation( new Path("test-eu-west-1-cyberduck", EnumSet.of(Path.Type.volume, Path.Type.directory)) )); assertEquals(new S3LocationFeature.S3Region("eu-central-1"), feature.getLocation( new Path("test-eu-central-1-cyberduck", EnumSet.of(Path.Type.volume, Path.Type.directory)) )); assertEquals(new S3LocationFeature.S3Region("us-east-1"), feature.getLocation( new Path("test-us-east-1-cyberduck", EnumSet.of(Path.Type.volume, Path.Type.directory)) )); assertEquals(unknown, feature.getLocation( new Path("/", EnumSet.of(Path.Type.volume, Path.Type.directory)) )); }
@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);  }