@Test public void testFindDefaultLocationInBookmark() throws Exception { final ProtocolFactory factory = new ProtocolFactory(new HashSet<>(Collections.singleton(new SwiftProtocol()))); final Profile profile = new ProfilePlistReader(factory).read( new Local("../profiles/Rackspace US (IAD).cyberduckprofile")); final SwiftSession session = new SwiftSession( new Host(profile, "identity.api.rackspacecloud.com", new Credentials( System.getProperties().getProperty("rackspace.key"), System.getProperties().getProperty("rackspace.secret") )), new DisabledX509TrustManager(), new DefaultX509KeyManager()) { }; assertEquals("IAD", session.getHost().getRegion()); final Region location = new SwiftRegionService(session).lookup(new Path("/test.cyberduck.ch", EnumSet.of(Path.Type.directory, Path.Type.volume))); assertNotNull(location); assertEquals("IAD", location.getRegionId()); }
public Region lookup(final Path file) throws BackgroundException { final Path container = containerService.getContainer(file); if(Location.unknown.equals(new SwiftLocationFeature.SwiftRegion(container.attributes().getRegion()))) { return this.lookup(location.getLocation(container)); } return this.lookup(new SwiftLocationFeature.SwiftRegion(container.attributes().getRegion())); }
SwiftRegionService { public Region lookup(final Path file) throws BackgroundException { final Path container = containerService.getContainer(file); if(Location.unknown.equals(new SwiftLocationFeature.SwiftRegion(container.attributes().getRegion()))) { return this.lookup(location.getLocation(container)); } return this.lookup(new SwiftLocationFeature.SwiftRegion(container.attributes().getRegion())); } }
SwiftRegionService { public Region lookup(final Path file) throws BackgroundException { final Path container = containerService.getContainer(file); if(Location.unknown.equals(new SwiftLocationFeature.SwiftRegion(container.attributes().getRegion()))) { return this.lookup(location.getLocation(container)); } return this.lookup(new SwiftLocationFeature.SwiftRegion(container.attributes().getRegion())); } SwiftRegionService(final SwiftSession session);  SwiftRegionService(final SwiftSession session, final SwiftLocationFeature location); }
SwiftRegionService { public Region lookup(final Path file) throws BackgroundException { final Path container = containerService.getContainer(file); if(Location.unknown.equals(new SwiftLocationFeature.SwiftRegion(container.attributes().getRegion()))) { return this.lookup(location.getLocation(container)); } return this.lookup(new SwiftLocationFeature.SwiftRegion(container.attributes().getRegion())); } SwiftRegionService(final SwiftSession session);  SwiftRegionService(final SwiftSession session, final SwiftLocationFeature location); Region lookup(final Path file); Region lookup(final Location.Name location); }
SwiftRegionService { public Region lookup(final Path file) throws BackgroundException { final Path container = containerService.getContainer(file); if(Location.unknown.equals(new SwiftLocationFeature.SwiftRegion(container.attributes().getRegion()))) { return this.lookup(location.getLocation(container)); } return this.lookup(new SwiftLocationFeature.SwiftRegion(container.attributes().getRegion())); } SwiftRegionService(final SwiftSession session);  SwiftRegionService(final SwiftSession session, final SwiftLocationFeature location); Region lookup(final Path file); Region lookup(final Location.Name location);  }