@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 testSetTimestampFolderExplicitImplicit() throws Exception {
        final Path folder = new DAVDirectoryFeature(session).mkdir(new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), new TransferStatus());
        new DAVTimestampFeature(session).setTimestamp(folder, 5100L);
        assertEquals(5000L, new DAVAttributesFinderFeature(session).find(folder).getModificationDate());
        assertEquals(5000L, new DefaultAttributesFinderFeature(session).find(folder).getModificationDate());
        Thread.sleep(1000L);
        final Path file = new DAVTouchFeature(session).touch(new Path(folder, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
        assertNotEquals(5000L, new DAVAttributesFinderFeature(session).find(folder).getModificationDate());
        assertNotEquals(5000L, new DefaultAttributesFinderFeature(session).find(folder).getModificationDate());
        new DAVDeleteFeature(session).delete(Arrays.asList(file, folder), new DisabledLoginCallback(), new Delete.DisabledCallback());
    }