@Test(expected = AccessDeniedException.class) public void testFailureWithServerSideEncryptionBucketPolicy() throws Exception { final Path container = new Path("sse-test-us-east-1-cyberduck", EnumSet.of(Path.Type.directory, Path.Type.volume)); final Path test = new Path(container, new AsciiRandomStringService().random(), EnumSet.of(Path.Type.file)); final S3TouchFeature touch = new S3TouchFeature(session); final TransferStatus status = new TransferStatus(); status.setEncryption(Encryption.Algorithm.NONE); touch.touch(test, status); }
@Override public Path touch(final Path file, final TransferStatus status) throws BackgroundException { status.setChecksum(writer.checksum(file, status).compute(new NullInputStream(0L), status)); status.setLength(0L); final StatusOutputStream<StorageObject> out = writer.write(file, status, new DisabledConnectionCallback()); new DefaultStreamCloser().close(out); final S3Object metadata = (S3Object) out.getStatus(); return new Path(file.getParent(), file.getName(), file.getType(), new S3AttributesFinderFeature(session).toAttributes(metadata)); }
S3TouchFeature implements Touch<StorageObject> { @Override public Path touch(final Path file, final TransferStatus status) throws BackgroundException { status.setChecksum(writer.checksum(file, status).compute(new NullInputStream(0L), status)); status.setLength(0L); final StatusOutputStream<StorageObject> out = writer.write(file, status, new DisabledConnectionCallback()); new DefaultStreamCloser().close(out); final S3Object metadata = (S3Object) out.getStatus(); return new Path(file.getParent(), file.getName(), file.getType(), new S3AttributesFinderFeature(session).toAttributes(metadata)); } }
S3TouchFeature implements Touch<StorageObject> { @Override public Path touch(final Path file, final TransferStatus status) throws BackgroundException { status.setChecksum(writer.checksum(file, status).compute(new NullInputStream(0L), status)); status.setLength(0L); final StatusOutputStream<StorageObject> out = writer.write(file, status, new DisabledConnectionCallback()); new DefaultStreamCloser().close(out); final S3Object metadata = (S3Object) out.getStatus(); return new Path(file.getParent(), file.getName(), file.getType(), new S3AttributesFinderFeature(session).toAttributes(metadata)); } S3TouchFeature(final S3Session session); }
S3TouchFeature implements Touch<StorageObject> { @Override public Path touch(final Path file, final TransferStatus status) throws BackgroundException { status.setChecksum(writer.checksum(file, status).compute(new NullInputStream(0L), status)); status.setLength(0L); final StatusOutputStream<StorageObject> out = writer.write(file, status, new DisabledConnectionCallback()); new DefaultStreamCloser().close(out); final S3Object metadata = (S3Object) out.getStatus(); return new Path(file.getParent(), file.getName(), file.getType(), new S3AttributesFinderFeature(session).toAttributes(metadata)); } S3TouchFeature(final S3Session session); @Override Path touch(final Path file, final TransferStatus status); @Override boolean isSupported(final Path workdir, final String filename); @Override Touch<StorageObject> withWriter(final Write<StorageObject> writer); }
S3TouchFeature implements Touch<StorageObject> { @Override public Path touch(final Path file, final TransferStatus status) throws BackgroundException { status.setChecksum(writer.checksum(file, status).compute(new NullInputStream(0L), status)); status.setLength(0L); final StatusOutputStream<StorageObject> out = writer.write(file, status, new DisabledConnectionCallback()); new DefaultStreamCloser().close(out); final S3Object metadata = (S3Object) out.getStatus(); return new Path(file.getParent(), file.getName(), file.getType(), new S3AttributesFinderFeature(session).toAttributes(metadata)); } S3TouchFeature(final S3Session session); @Override Path touch(final Path file, final TransferStatus status); @Override boolean isSupported(final Path workdir, final String filename); @Override Touch<StorageObject> withWriter(final Write<StorageObject> writer);  }