@Override
    public void setTimestamp(final Path file, final TransferStatus status) throws BackgroundException {
        try {
            if(null != status.getModified()) {
                final FileEntity response = new FilesApi(new BrickApiClient(session))
                        .patchFilesPath(StringUtils.removeStart(file.getAbsolute(), String.valueOf(Path.DELIMITER)),
                                new FilesPathBody().providedMtime(status.getModified() != null ? new DateTime(status.getModified()) : null));
                status.setResponse(new BrickAttributesFinderFeature(session).toAttributes(response));
            }
        }
        catch(ApiException e) {
            throw new BrickExceptionMappingService().map("Failure to write attributes of {0}", e, file);
        }
    }
@Test
    public void testSetTimestampFile() throws Exception {
        final Path file = new BrickTouchFeature(session).touch(new Path(new DefaultHomeFinderService(session).find(),
            new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
        final TransferStatus status = new TransferStatus().withModified(5000L);
        new BrickTimestampFeature(session).setTimestamp(file, status);
        final PathAttributes attr = new BrickAttributesFinderFeature(session).find(file);
        assertEquals(5000L, attr.getModificationDate());
        assertEquals(attr, status.getResponse());
        assertEquals(5000L, new DefaultAttributesFinderFeature(session).find(file).getModificationDate());
        new BrickDeleteFeature(session).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
    }