@Test public void testGetOrigin() { final Host origin = new Host(new TestProtocol(), "m"); final Path container = new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)); origin.setWebURL("http: final CustomOriginCloudFrontDistributionConfiguration configuration = new CustomOriginCloudFrontDistributionConfiguration(origin, new DefaultX509TrustManager(), new DefaultX509KeyManager()); assertEquals("w.example.net", configuration.getOrigin(container, Distribution.CUSTOM).getHost()); origin.setWebURL(null); assertEquals("m", configuration.getOrigin(container, Distribution.CUSTOM).getHost()); origin.setWebURL("f"); assertEquals("f", configuration.getOrigin(container, Distribution.CUSTOM).getHost()); }
@Override protected URI getOrigin(final Path container, final Distribution.Method method) { final URI url = URI.create(String.format("%s%s", new WebUrlProvider(origin).toUrl().getUrl(), PathNormalizer.normalize(origin.getDefaultPath(), true))); if(log.isDebugEnabled()) { log.debug(String.format("Use origin %s for distribution %s", url, method)); } return url; }
CustomOriginCloudFrontDistributionConfiguration extends CloudFrontDistributionConfiguration { @Override protected URI getOrigin(final Path container, final Distribution.Method method) { final URI url = URI.create(String.format("%s%s", new WebUrlProvider(origin).toUrl().getUrl(), PathNormalizer.normalize(origin.getDefaultPath(), true))); if(log.isDebugEnabled()) { log.debug(String.format("Use origin %s for distribution %s", url, method)); } return url; } }
CustomOriginCloudFrontDistributionConfiguration extends CloudFrontDistributionConfiguration { @Override protected URI getOrigin(final Path container, final Distribution.Method method) { final URI url = URI.create(String.format("%s%s", new WebUrlProvider(origin).toUrl().getUrl(), PathNormalizer.normalize(origin.getDefaultPath(), true))); if(log.isDebugEnabled()) { log.debug(String.format("Use origin %s for distribution %s", url, method)); } return url; } CustomOriginCloudFrontDistributionConfiguration(final Host origin,
                                                           final X509TrustManager trust,
                                                           final X509KeyManager key); }
CustomOriginCloudFrontDistributionConfiguration extends CloudFrontDistributionConfiguration { @Override protected URI getOrigin(final Path container, final Distribution.Method method) { final URI url = URI.create(String.format("%s%s", new WebUrlProvider(origin).toUrl().getUrl(), PathNormalizer.normalize(origin.getDefaultPath(), true))); if(log.isDebugEnabled()) { log.debug(String.format("Use origin %s for distribution %s", url, method)); } return url; } CustomOriginCloudFrontDistributionConfiguration(final Host origin,
                                                           final X509TrustManager trust,
                                                           final X509KeyManager key); @Override Distribution read(final Path file, final Distribution.Method method, final LoginCallback prompt); @Override void write(final Path file, final Distribution distribution, final LoginCallback prompt); @Override List<Distribution.Method> getMethods(final Path container); @Override DescriptiveUrlBag toUrl(final Path file); }
CustomOriginCloudFrontDistributionConfiguration extends CloudFrontDistributionConfiguration { @Override protected URI getOrigin(final Path container, final Distribution.Method method) { final URI url = URI.create(String.format("%s%s", new WebUrlProvider(origin).toUrl().getUrl(), PathNormalizer.normalize(origin.getDefaultPath(), true))); if(log.isDebugEnabled()) { log.debug(String.format("Use origin %s for distribution %s", url, method)); } return url; } CustomOriginCloudFrontDistributionConfiguration(final Host origin,
                                                           final X509TrustManager trust,
                                                           final X509KeyManager key); @Override Distribution read(final Path file, final Distribution.Method method, final LoginCallback prompt); @Override void write(final Path file, final Distribution distribution, final LoginCallback prompt); @Override List<Distribution.Method> getMethods(final Path container); @Override DescriptiveUrlBag toUrl(final Path file);  }