@Override
    public void setTimestamp(final Path file, final TransferStatus status) throws BackgroundException {
        try {
            final SoftwareVersionData version = session.softwareVersion();
            final Matcher matcher = Pattern.compile(SDSSession.VERSION_REGEX).matcher(version.getRestApiVersion());
            if(matcher.matches()) {
                if(new Version(matcher.group(1)).compareTo(new Version("4.22")) < 0) {
                    throw new UnsupportedException();
                }
            }
            final Node latest;
            if(containerService.isContainer(file)) {
                latest = new NodesApi(session.getClient()).updateRoom(new UpdateRoomRequest()
                                .timestampCreation(null != status.getCreated() ? new DateTime(status.getCreated()) : null)
                                .timestampModification(null != status.getModified() ? new DateTime(status.getModified()) : null),
                        Long.parseLong(nodeid.getVersionId(file)), StringUtils.EMPTY, null);
            }
            else if(file.isDirectory()) {
                latest = new NodesApi(session.getClient()).updateFolder(new UpdateFolderRequest()
                                .timestampCreation(null != status.getCreated() ? new DateTime(status.getCreated()) : null)
                                .timestampModification(null != status.getModified() ? new DateTime(status.getModified()) : null),
                        Long.parseLong(nodeid.getVersionId(file)), StringUtils.EMPTY, null);
            }
            else {
                latest = new NodesApi(session.getClient()).updateFile(new UpdateFileRequest()
                                .timestampCreation(null != status.getCreated() ? new DateTime(status.getCreated()) : null)
                                .timestampModification(null != status.getModified() ? new DateTime(status.getModified()) : null),
                        Long.parseLong(nodeid.getVersionId(file)), StringUtils.EMPTY, null);
            }
            status.setResponse(new SDSAttributesAdapter(session).toAttributes(latest));
        }
        catch(ApiException e) {
            throw new SDSExceptionMappingService(nodeid).map("Failure to write attributes of {0}", e, file);
        }
    }
@Test
    public void testWriteTimestampRoom() throws Exception {
        final SDSNodeIdProvider nodeid = new SDSNodeIdProvider(session);
        final Path room = new SDSDirectoryFeature(session, nodeid).mkdir(
                new Path(new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory, Path.Type.volume)), new TransferStatus());
        new SDSTimestampFeature(session, nodeid).setTimestamp(room, 1599047952805L);
        final SDSAttributesFinderFeature f = new SDSAttributesFinderFeature(session, nodeid);
        final PathAttributes attributes = f.find(room);
        assertEquals(1599047952805L, attributes.getModificationDate());
        new SDSDeleteFeature(session, nodeid).delete(Collections.singletonList(room), new DisabledLoginCallback(), new Delete.DisabledCallback());
    }