@Test public void testForbidden() throws Exception { final Host host = new Host(new S3Protocol(), "dist.springframework.org.s3.amazonaws.com", new Credentials( PreferencesFactory.get().getProperty("connection.login.anon.name"), null )); final S3Session session = new S3Session(host); final LoginConnectionService login = new LoginConnectionService(new DisabledLoginCallback() { @Override public Credentials prompt(final Host bookmark, final String username, final String title, final String reason, final LoginOptions options) { fail(reason); return null; } }, new DisabledHostKeyCallback(), new DisabledPasswordStore(), new DisabledProgressListener()); login.check(session, PathCache.empty(), new DisabledCancelCallback()); assertEquals(unknown, new S3LocationFeature(session).getLocation(new Path("/dist.springframework.org", 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);  }