@Test public void testFeatures() { final DistributionConfiguration d = new GoogleStorageWebsiteDistributionConfiguration(session); assertNotNull(d.getFeature(Index.class, Distribution.WEBSITE)); assertNotNull(d.getFeature(DistributionLogging.class, Distribution.WEBSITE)); assertNull(d.getFeature(Cname.class, Distribution.WEBSITE)); }
@Override @SuppressWarnings("unchecked") public <T> T getFeature(final Class<T> type, final Distribution.Method method) { if(type == Index.class) { return (T) this; } if(type == DistributionLogging.class) { return (T) new GoogleStorageLoggingFeature(session); } return null; }
GoogleStorageWebsiteDistributionConfiguration implements DistributionConfiguration, Index { @Override @SuppressWarnings("unchecked") public <T> T getFeature(final Class<T> type, final Distribution.Method method) { if(type == Index.class) { return (T) this; } if(type == DistributionLogging.class) { return (T) new GoogleStorageLoggingFeature(session); } return null; } }
GoogleStorageWebsiteDistributionConfiguration implements DistributionConfiguration, Index { @Override @SuppressWarnings("unchecked") public <T> T getFeature(final Class<T> type, final Distribution.Method method) { if(type == Index.class) { return (T) this; } if(type == DistributionLogging.class) { return (T) new GoogleStorageLoggingFeature(session); } return null; } GoogleStorageWebsiteDistributionConfiguration(final GoogleStorageSession session); }
GoogleStorageWebsiteDistributionConfiguration implements DistributionConfiguration, Index { @Override @SuppressWarnings("unchecked") public <T> T getFeature(final Class<T> type, final Distribution.Method method) { if(type == Index.class) { return (T) this; } if(type == DistributionLogging.class) { return (T) new GoogleStorageLoggingFeature(session); } return null; } GoogleStorageWebsiteDistributionConfiguration(final GoogleStorageSession session); @Override List<Distribution.Method> getMethods(final Path container); @Override String getName(Distribution.Method method); @Override String getName(); @Override DescriptiveUrlBag toUrl(final Path file); @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 @SuppressWarnings("unchecked") T getFeature(final Class<T> type, final Distribution.Method method); @Override String getHostname(); }
GoogleStorageWebsiteDistributionConfiguration implements DistributionConfiguration, Index { @Override @SuppressWarnings("unchecked") public <T> T getFeature(final Class<T> type, final Distribution.Method method) { if(type == Index.class) { return (T) this; } if(type == DistributionLogging.class) { return (T) new GoogleStorageLoggingFeature(session); } return null; } GoogleStorageWebsiteDistributionConfiguration(final GoogleStorageSession session); @Override List<Distribution.Method> getMethods(final Path container); @Override String getName(Distribution.Method method); @Override String getName(); @Override DescriptiveUrlBag toUrl(final Path file); @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 @SuppressWarnings("unchecked") T getFeature(final Class<T> type, final Distribution.Method method); @Override String getHostname();  }