@Test(expected = NotfoundException.class) public void testWriteNotFound() throws Exception { new GoogleStorageLoggingFeature(session).setConfiguration( new Path(UUID.randomUUID().toString(), EnumSet.of(Path.Type.directory)), new LoggingConfiguration(false) ); }
@Override public void setConfiguration(final Path container, final LoggingConfiguration configuration) throws BackgroundException { try { session.getClient().buckets().patch(container.getName(), new Bucket().setLogging(new Bucket.Logging() .setLogObjectPrefix(configuration.isEnabled() ? PreferencesFactory.get().getProperty("google.logging.prefix") : null) .setLogBucket(StringUtils.isNotBlank(configuration.getLoggingTarget()) ? configuration.getLoggingTarget() : container.getName())) ).execute(); } catch(IOException e) { throw new GoogleStorageExceptionMappingService().map("Failure to write attributes of {0}", e, container); } }
GoogleStorageLoggingFeature implements Logging, DistributionLogging { @Override public void setConfiguration(final Path container, final LoggingConfiguration configuration) throws BackgroundException { try { session.getClient().buckets().patch(container.getName(), new Bucket().setLogging(new Bucket.Logging() .setLogObjectPrefix(configuration.isEnabled() ? PreferencesFactory.get().getProperty("google.logging.prefix") : null) .setLogBucket(StringUtils.isNotBlank(configuration.getLoggingTarget()) ? configuration.getLoggingTarget() : container.getName())) ).execute(); } catch(IOException e) { throw new GoogleStorageExceptionMappingService().map("Failure to write attributes of {0}", e, container); } } }
GoogleStorageLoggingFeature implements Logging, DistributionLogging { @Override public void setConfiguration(final Path container, final LoggingConfiguration configuration) throws BackgroundException { try { session.getClient().buckets().patch(container.getName(), new Bucket().setLogging(new Bucket.Logging() .setLogObjectPrefix(configuration.isEnabled() ? PreferencesFactory.get().getProperty("google.logging.prefix") : null) .setLogBucket(StringUtils.isNotBlank(configuration.getLoggingTarget()) ? configuration.getLoggingTarget() : container.getName())) ).execute(); } catch(IOException e) { throw new GoogleStorageExceptionMappingService().map("Failure to write attributes of {0}", e, container); } } GoogleStorageLoggingFeature(final GoogleStorageSession session); }
GoogleStorageLoggingFeature implements Logging, DistributionLogging { @Override public void setConfiguration(final Path container, final LoggingConfiguration configuration) throws BackgroundException { try { session.getClient().buckets().patch(container.getName(), new Bucket().setLogging(new Bucket.Logging() .setLogObjectPrefix(configuration.isEnabled() ? PreferencesFactory.get().getProperty("google.logging.prefix") : null) .setLogBucket(StringUtils.isNotBlank(configuration.getLoggingTarget()) ? configuration.getLoggingTarget() : container.getName())) ).execute(); } catch(IOException e) { throw new GoogleStorageExceptionMappingService().map("Failure to write attributes of {0}", e, container); } } GoogleStorageLoggingFeature(final GoogleStorageSession session); @Override LoggingConfiguration getConfiguration(final Path file); @Override void setConfiguration(final Path container, final LoggingConfiguration configuration); }
GoogleStorageLoggingFeature implements Logging, DistributionLogging { @Override public void setConfiguration(final Path container, final LoggingConfiguration configuration) throws BackgroundException { try { session.getClient().buckets().patch(container.getName(), new Bucket().setLogging(new Bucket.Logging() .setLogObjectPrefix(configuration.isEnabled() ? PreferencesFactory.get().getProperty("google.logging.prefix") : null) .setLogBucket(StringUtils.isNotBlank(configuration.getLoggingTarget()) ? configuration.getLoggingTarget() : container.getName())) ).execute(); } catch(IOException e) { throw new GoogleStorageExceptionMappingService().map("Failure to write attributes of {0}", e, container); } } GoogleStorageLoggingFeature(final GoogleStorageSession session); @Override LoggingConfiguration getConfiguration(final Path file); @Override void setConfiguration(final Path container, final LoggingConfiguration configuration);  }