@Test(expected = NotfoundException.class) public void testWriteNotFound() throws Exception { new S3LoggingFeature(session).setConfiguration( new Path(UUID.randomUUID().toString(), EnumSet.of(Path.Type.directory)), new LoggingConfiguration(false) ); }
@Override public void setConfiguration(final Path file, final LoggingConfiguration configuration) throws BackgroundException { final Path bucket = containerService.getContainer(file); try { final S3BucketLoggingStatus status = new S3BucketLoggingStatus( StringUtils.isNotBlank(configuration.getLoggingTarget()) ? configuration.getLoggingTarget() : bucket.getName(), null); if(configuration.isEnabled()) { status.setLogfilePrefix(PreferencesFactory.get().getProperty("s3.logging.prefix")); } session.getClient().setBucketLoggingStatus(bucket.getName(), status, true); } catch(ServiceException e) { throw new S3ExceptionMappingService().map("Failure to write attributes of {0}", e, file); } }
S3LoggingFeature implements Logging { @Override public void setConfiguration(final Path file, final LoggingConfiguration configuration) throws BackgroundException { final Path bucket = containerService.getContainer(file); try { final S3BucketLoggingStatus status = new S3BucketLoggingStatus( StringUtils.isNotBlank(configuration.getLoggingTarget()) ? configuration.getLoggingTarget() : bucket.getName(), null); if(configuration.isEnabled()) { status.setLogfilePrefix(PreferencesFactory.get().getProperty("s3.logging.prefix")); } session.getClient().setBucketLoggingStatus(bucket.getName(), status, true); } catch(ServiceException e) { throw new S3ExceptionMappingService().map("Failure to write attributes of {0}", e, file); } } }
S3LoggingFeature implements Logging { @Override public void setConfiguration(final Path file, final LoggingConfiguration configuration) throws BackgroundException { final Path bucket = containerService.getContainer(file); try { final S3BucketLoggingStatus status = new S3BucketLoggingStatus( StringUtils.isNotBlank(configuration.getLoggingTarget()) ? configuration.getLoggingTarget() : bucket.getName(), null); if(configuration.isEnabled()) { status.setLogfilePrefix(PreferencesFactory.get().getProperty("s3.logging.prefix")); } session.getClient().setBucketLoggingStatus(bucket.getName(), status, true); } catch(ServiceException e) { throw new S3ExceptionMappingService().map("Failure to write attributes of {0}", e, file); } } S3LoggingFeature(final S3Session session); }
S3LoggingFeature implements Logging { @Override public void setConfiguration(final Path file, final LoggingConfiguration configuration) throws BackgroundException { final Path bucket = containerService.getContainer(file); try { final S3BucketLoggingStatus status = new S3BucketLoggingStatus( StringUtils.isNotBlank(configuration.getLoggingTarget()) ? configuration.getLoggingTarget() : bucket.getName(), null); if(configuration.isEnabled()) { status.setLogfilePrefix(PreferencesFactory.get().getProperty("s3.logging.prefix")); } session.getClient().setBucketLoggingStatus(bucket.getName(), status, true); } catch(ServiceException e) { throw new S3ExceptionMappingService().map("Failure to write attributes of {0}", e, file); } } S3LoggingFeature(final S3Session session); @Override LoggingConfiguration getConfiguration(final Path file); @Override void setConfiguration(final Path file, final LoggingConfiguration configuration); }
S3LoggingFeature implements Logging { @Override public void setConfiguration(final Path file, final LoggingConfiguration configuration) throws BackgroundException { final Path bucket = containerService.getContainer(file); try { final S3BucketLoggingStatus status = new S3BucketLoggingStatus( StringUtils.isNotBlank(configuration.getLoggingTarget()) ? configuration.getLoggingTarget() : bucket.getName(), null); if(configuration.isEnabled()) { status.setLogfilePrefix(PreferencesFactory.get().getProperty("s3.logging.prefix")); } session.getClient().setBucketLoggingStatus(bucket.getName(), status, true); } catch(ServiceException e) { throw new S3ExceptionMappingService().map("Failure to write attributes of {0}", e, file); } } S3LoggingFeature(final S3Session session); @Override LoggingConfiguration getConfiguration(final Path file); @Override void setConfiguration(final Path file, final LoggingConfiguration configuration);  }