@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 testDav() {
        final Host host = new Host(new TestProtocol(), "test.cyberduck.ch", new Credentials(
                "u", "p"
        ));
        host.setDefaultPath("/my/documentroot");
        assertEquals("http://test.cyberduck.ch/my/documentroot/f",
                new DefaultUrlProvider(host).toUrl(new Path("/my/documentroot/f", EnumSet.of(Path.Type.directory))).find(DescriptiveUrl.Type.provider).getUrl());
        assertEquals("http://test.cyberduck.ch/f",
                new DefaultUrlProvider(host).toUrl(new Path("/my/documentroot/f", EnumSet.of(Path.Type.directory))).find(DescriptiveUrl.Type.http).getUrl());
    }