@Test(expected = InteroperabilityException.class) public void testWriteChunkedTransferAWS2SignatureFailure() throws Exception { session.setSignatureVersion(S3Protocol.AuthenticationHeaderSignatureVersion.AWS2); final S3WriteFeature feature = new S3WriteFeature(session); final Path container = new Path("test-eu-central-1-cyberduck", EnumSet.of(Path.Type.volume)); final TransferStatus status = new TransferStatus(); status.setLength(-1L); final Path file = new Path(container, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file)); feature.write(file, status, new DisabledConnectionCallback()); }
@Override public HttpResponseOutputStream<StorageObject> write(final Path file, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { final S3Object object = this.getDetails(file, status); final DelayedHttpEntityCallable<StorageObject> command = new DelayedHttpEntityCallable<StorageObject>() { @Override public StorageObject call(final AbstractHttpEntity entity) throws BackgroundException { try { final RequestEntityRestStorageService client = session.getClient(); client.putObjectWithRequestEntityImpl( containerService.getContainer(file).getName(), object, entity, status.getParameters()); if(log.isDebugEnabled()) { log.debug(String.format("Saved object %s with checksum %s", file, object.getETag())); } } catch(ServiceException e) { throw new S3ExceptionMappingService().map("Upload {0} failed", e, file); } return object; } @Override public long getContentLength() { return status.getLength(); } }; return this.write(file, status, command); }
S3WriteFeature extends AbstractHttpWriteFeature<StorageObject> implements Write<StorageObject> { @Override public HttpResponseOutputStream<StorageObject> write(final Path file, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { final S3Object object = this.getDetails(file, status); final DelayedHttpEntityCallable<StorageObject> command = new DelayedHttpEntityCallable<StorageObject>() { @Override public StorageObject call(final AbstractHttpEntity entity) throws BackgroundException { try { final RequestEntityRestStorageService client = session.getClient(); client.putObjectWithRequestEntityImpl( containerService.getContainer(file).getName(), object, entity, status.getParameters()); if(log.isDebugEnabled()) { log.debug(String.format("Saved object %s with checksum %s", file, object.getETag())); } } catch(ServiceException e) { throw new S3ExceptionMappingService().map("Upload {0} failed", e, file); } return object; } @Override public long getContentLength() { return status.getLength(); } }; return this.write(file, status, command); } }
S3WriteFeature extends AbstractHttpWriteFeature<StorageObject> implements Write<StorageObject> { @Override public HttpResponseOutputStream<StorageObject> write(final Path file, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { final S3Object object = this.getDetails(file, status); final DelayedHttpEntityCallable<StorageObject> command = new DelayedHttpEntityCallable<StorageObject>() { @Override public StorageObject call(final AbstractHttpEntity entity) throws BackgroundException { try { final RequestEntityRestStorageService client = session.getClient(); client.putObjectWithRequestEntityImpl( containerService.getContainer(file).getName(), object, entity, status.getParameters()); if(log.isDebugEnabled()) { log.debug(String.format("Saved object %s with checksum %s", file, object.getETag())); } } catch(ServiceException e) { throw new S3ExceptionMappingService().map("Upload {0} failed", e, file); } return object; } @Override public long getContentLength() { return status.getLength(); } }; return this.write(file, status, command); } S3WriteFeature(final S3Session session);  S3WriteFeature(final S3Session session, final S3MultipartService multipartService);  S3WriteFeature(final S3Session session, final S3MultipartService multipartService,
                          final Find finder, final AttributesFinder attributes); }
S3WriteFeature extends AbstractHttpWriteFeature<StorageObject> implements Write<StorageObject> { @Override public HttpResponseOutputStream<StorageObject> write(final Path file, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { final S3Object object = this.getDetails(file, status); final DelayedHttpEntityCallable<StorageObject> command = new DelayedHttpEntityCallable<StorageObject>() { @Override public StorageObject call(final AbstractHttpEntity entity) throws BackgroundException { try { final RequestEntityRestStorageService client = session.getClient(); client.putObjectWithRequestEntityImpl( containerService.getContainer(file).getName(), object, entity, status.getParameters()); if(log.isDebugEnabled()) { log.debug(String.format("Saved object %s with checksum %s", file, object.getETag())); } } catch(ServiceException e) { throw new S3ExceptionMappingService().map("Upload {0} failed", e, file); } return object; } @Override public long getContentLength() { return status.getLength(); } }; return this.write(file, status, command); } S3WriteFeature(final S3Session session);  S3WriteFeature(final S3Session session, final S3MultipartService multipartService);  S3WriteFeature(final S3Session session, final S3MultipartService multipartService,
                          final Find finder, final AttributesFinder attributes); @Override HttpResponseOutputStream<StorageObject> write(final Path file, final TransferStatus status, final ConnectionCallback callback); @Override Append append(final Path file, final Long length, final Cache<Path> cache); @Override boolean temporary(); @Override boolean random(); @Override ChecksumCompute checksum(final Path file, final TransferStatus status); }
S3WriteFeature extends AbstractHttpWriteFeature<StorageObject> implements Write<StorageObject> { @Override public HttpResponseOutputStream<StorageObject> write(final Path file, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { final S3Object object = this.getDetails(file, status); final DelayedHttpEntityCallable<StorageObject> command = new DelayedHttpEntityCallable<StorageObject>() { @Override public StorageObject call(final AbstractHttpEntity entity) throws BackgroundException { try { final RequestEntityRestStorageService client = session.getClient(); client.putObjectWithRequestEntityImpl( containerService.getContainer(file).getName(), object, entity, status.getParameters()); if(log.isDebugEnabled()) { log.debug(String.format("Saved object %s with checksum %s", file, object.getETag())); } } catch(ServiceException e) { throw new S3ExceptionMappingService().map("Upload {0} failed", e, file); } return object; } @Override public long getContentLength() { return status.getLength(); } }; return this.write(file, status, command); } S3WriteFeature(final S3Session session);  S3WriteFeature(final S3Session session, final S3MultipartService multipartService);  S3WriteFeature(final S3Session session, final S3MultipartService multipartService,
                          final Find finder, final AttributesFinder attributes); @Override HttpResponseOutputStream<StorageObject> write(final Path file, final TransferStatus status, final ConnectionCallback callback); @Override Append append(final Path file, final Long length, final Cache<Path> cache); @Override boolean temporary(); @Override boolean random(); @Override ChecksumCompute checksum(final Path file, final TransferStatus status);  }