@Override
    public void setTimestamp(final Path file, final TransferStatus status) throws BackgroundException {
        try {
            final String resourceId = fileid.getFileId(file);
            final ResourceUpdateModel resourceUpdateModel = new ResourceUpdateModel();
            ResourceUpdateModelUpdate resourceUpdateModelUpdate = new ResourceUpdateModelUpdate();
            UiWin32 uiWin32 = new UiWin32();
            uiWin32.setCreationMillis(null != status.getCreated() ? status.getCreated() : null);
            uiWin32.setLastModificationMillis(null != status.getModified() ? status.getModified() : null);
            resourceUpdateModelUpdate.setUiwin32(uiWin32);
            resourceUpdateModel.setUpdate(resourceUpdateModelUpdate);
            new UpdateResourceApi(new EueApiClient(session)).resourceResourceIdPatch(resourceId,
                    resourceUpdateModel, null, null, null);
        }
        catch(ApiException e) {
            throw new EueExceptionMappingService().map("Failure to write attributes of {0}", e, file);
        }
    }
@Test
    public void testSetTimestampDirectory() throws Exception {
        final EueResourceIdProvider fileid = new EueResourceIdProvider(session);
        final Path container = new EueDirectoryFeature(session, fileid).mkdir(new Path(
                new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory, Path.Type.volume)), new TransferStatus());
        final long containerModification = new EueAttributesFinderFeature(session, fileid).find(container).getModificationDate();
        final Path folder = new EueDirectoryFeature(session, fileid).mkdir(new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), null);
        final long folderModification = new EueAttributesFinderFeature(session, fileid).find(folder).getModificationDate();
        assertNotNull(new EueAttributesFinderFeature(session, fileid).find(folder));
        final long modified = Instant.now().minusSeconds(5 * 24 * 60 * 60).getEpochSecond() * 1000;
        new EueTimestampFeature(session, fileid).setTimestamp(folder, modified);
        assertEquals(modified, new EueAttributesFinderFeature(session, fileid).find(folder).getModificationDate());
        // Write file to directory and see if timestamp changes
        final Path file = new EueTouchFeature(session, fileid).touch(new Path(folder, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
        assertEquals(modified, new EueAttributesFinderFeature(session, fileid).find(folder).getModificationDate());
        assertEquals(containerModification, new EueAttributesFinderFeature(session, fileid).find(container).getModificationDate());
        final byte[] content = RandomUtils.nextBytes(8235);
        final long ts = System.currentTimeMillis();
        final TransferStatus status = new TransferStatus().withLength(content.length).withModified(ts);
        final Checksum checksum = new EueWriteFeature(session, fileid).checksum(file, status).compute(new ByteArrayInputStream(content), new TransferStatus().withLength(content.length));
        status.withChecksum(checksum);
        final HttpResponseOutputStream<EueWriteFeature.Chunk> out = new EueWriteFeature(session, fileid).write(file, status.exists(true), new DisabledConnectionCallback());
        final ByteArrayInputStream in = new ByteArrayInputStream(content);
        final TransferStatus progress = new TransferStatus();
        final BytecountStreamListener count = new BytecountStreamListener();
        new StreamCopier(new TransferStatus(), progress).withListener(count).transfer(in, out);
        assertEquals(containerModification, new EueAttributesFinderFeature(session, fileid).find(container).getModificationDate());
        assertNotEquals(folderModification, new EueAttributesFinderFeature(session, fileid).find(folder).getModificationDate());
        new EueDeleteFeature(session, fileid).delete(Collections.singletonList(container), new DisabledLoginCallback(), new Delete.DisabledCallback());
    }