@Override
    public DescriptiveUrlBag toUrl(final Path file) {
        return new DescriptiveUrlBag(Collections.singletonList(
            new DescriptiveUrl(URI.create(String.format("https://webmail.freenet.de/web/?goTo=share&path=/%s#cloud",
                URIEncoder.encode(PathRelativizer.relativize(PathNormalizer.normalize(host.getDefaultPath(), true), file.isFile() ?
                    file.getParent().getAbsolute() : file.getAbsolute())))), DescriptiveUrl.Type.http)
        ));
    }
@Test
    public void testToUrlRoot() {
        final FreenetUrlProvider provider = new FreenetUrlProvider(new Host(new FreenetProtocol(), "dav.freenet.de", 443, "/webdav"));
        final DescriptiveUrlBag urls = provider.toUrl(new Path("/webdav", EnumSet.of(Path.Type.directory)));
        assertEquals(1, urls.size());
        final DescriptiveUrl url = urls.find(DescriptiveUrl.Type.http);
        assertNotEquals(DescriptiveUrl.EMPTY, url);
        assertEquals(DescriptiveUrl.Type.http, url.getType());
        assertEquals("https://webmail.freenet.de/web/?goTo=share&path=/#cloud", url.getUrl());
    }