@Override
    public DescriptiveUrlBag toUrl(final Path file) {
        final DescriptiveUrlBag list = new DescriptiveUrlBag();
        if(file.attributes().getLink() != DescriptiveUrl.EMPTY) {
            list.add(file.attributes().getLink());
        }
        list.add(new DescriptiveUrl(URI.create(String.format("%s%s",
            new HostUrlProvider().withUsername(false).get(host), URIEncoder.encode(file.getAbsolute()))),
            DescriptiveUrl.Type.provider,
            MessageFormat.format(LocaleFactory.localizedString("{0} URL"), host.getProtocol().getScheme().toString().toUpperCase(Locale.ROOT))));
        list.addAll(new HostWebUrlProvider(host).toUrl(file));
        return list;
    }
@Test
    public void testRelativeDocumentRoot() {
        Host host = new Host(new TestProtocol(), "localhost");
        host.setDefaultPath("public_html");
        Path path = new Path(
                "/usr/home/dkocher/public_html/file", EnumSet.of(Path.Type.directory));
        assertEquals("http://localhost/file", new DefaultUrlProvider(host).toUrl(path).find(DescriptiveUrl.Type.http).getUrl());
        host.setWebURL("http://127.0.0.1/~dkocher");
        assertEquals("http://127.0.0.1/~dkocher/file", new DefaultUrlProvider(host).toUrl(path).find(DescriptiveUrl.Type.http).getUrl());
    }