@Override
    public void setTimestamp(final Path file, final TransferStatus status) throws BackgroundException {
        try {
            if(null != status.getModified()) {
                final DavResource resource = this.getResource(file);
                session.getClient().patch(new DAVPathEncoder().encode(file), this.getCustomProperties(resource, status.getModified()), Collections.emptyList(),
                        this.getCustomHeaders(file, status));
                status.setResponse(new DAVAttributesFinderFeature(session).toAttributes(resource).withModificationDate(
                        Timestamp.toSeconds(status.getModified())));
            }
        }
        catch(SardineException e) {
            throw new DAVExceptionMappingService().map("Failure to write attributes of {0}", e, file);
        }
        catch(IOException e) {
            throw new DefaultIOExceptionMappingService().map(e, file);
        }
    }
@Test
    public void testSetTimestamp() throws Exception {
        final TransferStatus status = new TransferStatus();
        final Path file = new DAVTouchFeature(session).touch(new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), status);
        new DAVTimestampFeature(session).setTimestamp(file, status.withModified(5100L));
        final PathAttributes attr = new DAVAttributesFinderFeature(session).find(file);
        assertEquals(5000L, attr.getModificationDate());
        assertEquals(status.getResponse(), attr);
        assertEquals(5000L, new DefaultAttributesFinderFeature(session).find(file).getModificationDate());
        new DAVDeleteFeature(session).delete(Collections.<Path>singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
    }