@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>(file) {
            @Override
            public StorageObject call(final HttpEntity entity) throws BackgroundException {
                try {
                    final RequestEntityRestStorageService client = session.getClient();
                    final Path bucket = containerService.getContainer(file);
                    client.putObjectWithRequestEntityImpl(
                            bucket.isRoot() ? StringUtils.EMPTY : bucket.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);
    }
@Test
    public void testWriteCustomTimestamp() throws Exception {
        final Path container = new Path("versioning-test-eu-central-1-cyberduck", EnumSet.of(Path.Type.volume, Path.Type.directory));
        final Path test = new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
        final TransferStatus status = new TransferStatus().withModified(1630305150672L).withCreated(1695159781972L);
        final byte[] content = RandomUtils.nextBytes(1033);
        status.setChecksum(new SHA256ChecksumCompute().compute(new ByteArrayInputStream(content), status));
        status.setLength(content.length);
        final S3AccessControlListFeature acl = new S3AccessControlListFeature(session);
        final HttpResponseOutputStream<StorageObject> out = new S3WriteFeature(session, acl).write(test, status, new DisabledConnectionCallback());
        new StreamCopier(new TransferStatus(), new TransferStatus()).transfer(new ByteArrayInputStream(content), out);
        out.close();
        test.withAttributes(new S3AttributesAdapter(session.getHost()).toAttributes(out.getStatus()));
        assertTrue(new S3FindFeature(session, acl).find(test));
        final PathAttributes attributes = new S3AttributesFinderFeature(session, acl).find(test);
        assertEquals(1630305150000L, attributes.getModificationDate());
        assertEquals(1695159781000L, attributes.getCreationDate());
        assertEquals(1630305150000L, new S3ObjectListService(session, acl, true).list(container,
                new DisabledListProgressListener()).find(new DefaultPathPredicate(test)).attributes().getModificationDate());
        assertEquals(1630305150000L, new S3VersionedObjectListService(session, acl, 50, true).list(container,
                new DisabledListProgressListener()).find(new DefaultPathPredicate(test)).attributes().getModificationDate());
        assertNotEquals(1630305150000L, new S3ObjectListService(session, acl, false).list(container,
                new DisabledListProgressListener()).find(new SimplePathPredicate(test)).attributes().getModificationDate());
        assertNotEquals(1630305150000L, new S3VersionedObjectListService(session, acl, 50, false).list(container,
                new DisabledListProgressListener()).find(new SimplePathPredicate(test)).attributes().getModificationDate());
        final Path moved = new S3MoveFeature(session, acl).move(test, new Path(container,
                new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus(), new Delete.DisabledCallback(), new DisabledConnectionCallback());
        assertEquals(1630305150000L, new S3AttributesFinderFeature(session, acl).find(moved).getModificationDate());
        new S3DefaultDeleteFeature(session).delete(Collections.singletonList(moved), new DisabledLoginCallback(), new Delete.DisabledCallback());
    }