@Override
    public PathAttributes toAttributes(final DavResource resource) {
        final PathAttributes attributes = super.toAttributes(resource);
        final Map<QName, String> properties = resource.getCustomPropsNS();
        if(null != properties) {
            if(properties.containsKey(OC_FILEID_CUSTOM_NAMESPACE)) {
                final String value = properties.get(OC_FILEID_CUSTOM_NAMESPACE);
                attributes.setFileId(value);
            }
            if(resource.isDirectory()) {
                if(properties.containsKey(OC_SIZE_CUSTOM_NAMESPACE)) {
                    final String value = properties.get(OC_SIZE_CUSTOM_NAMESPACE);
                    attributes.setSize(Long.parseLong(value));
                }
            }
            if(properties.containsKey(OC_CHECKSUMS_CUSTOM_NAMESPACE)) {
                for(String v : StringUtils.split(properties.get(OC_CHECKSUMS_CUSTOM_NAMESPACE), StringUtils.SPACE)) {
                    try {
                        attributes.setChecksum(new Checksum(HashAlgorithm.valueOf(StringUtils.lowerCase(StringUtils.split(v, ":")[0])),
                                StringUtils.lowerCase(StringUtils.split(v, ":")[1])));
                    }
                    catch(IllegalArgumentException e) {
                        log.warn(String.format("Unsupported checksum %s", v));
                    }
                }
            }
        }
        return attributes;
    }
@Test
    public void testCustomModified_Modified() {
        final NextcloudAttributesFinderFeature f = new NextcloudAttributesFinderFeature(null);
        final DavResource mock = mock(DavResource.class);

        Map<QName, String> map = new HashMap<>();
        map.put(DAVTimestampFeature.LAST_MODIFIED_CUSTOM_NAMESPACE, "Mon, 29 Oct 2018 21:14:06 UTC");
        map.put(DAVTimestampFeature.LAST_MODIFIED_SERVER_CUSTOM_NAMESPACE, "Thu, 01 Nov 2018 15:31:57 UTC");
        final Date modified = new DateTime("2018-11-02T15:31:57Z").toDate();
        when(mock.getModified()).thenReturn(modified);
        when(mock.getCustomPropsNS()).thenReturn(map);

        final PathAttributes attrs = f.toAttributes(mock);
        assertEquals(modified.getTime(), attrs.getModificationDate());
    }