public Path parse(final String uri) throws HostParserException {
        final Host host = new HostParser(factory).get(uri);
        if(StringUtils.isBlank(host.getDefaultPath())) {
            return new Path(String.valueOf(Path.DELIMITER), EnumSet.of((Path.Type.directory)));
        }
        switch(new ContainerPathKindDetector(host.getProtocol().getFeature(PathContainerService.class)).detect(host.getDefaultPath())) {
            case directory:
                return new Path(PathNormalizer.normalize(host.getDefaultPath()), EnumSet.of(Path.Type.directory,
                        Path.Type.volume));
        }
        return new Path(PathNormalizer.normalize(host.getDefaultPath()), EnumSet.of(
                new DelimiterPathKindDetector().detect(host.getDefaultPath())));
    }
@Test
    public void testParseProfile() throws Exception {
        final ProtocolFactory factory = new ProtocolFactory(new HashSet<>(Collections.singleton(new SwiftProtocol())));
        final ProfilePlistReader reader = new ProfilePlistReader(factory);
        final Profile profile = reader.read(
            this.getClass().getResourceAsStream("/Rackspace US.cyberduckprofile")
        );
        assertNotNull(profile);
        factory.register(profile);

        final CommandLineParser parser = new PosixParser();
        final CommandLine input = parser.parse(new Options(), new String[]{});

        assertEquals(new Path("/cdn.cyberduck.ch", EnumSet.of(Path.Type.directory, Path.Type.volume)),
            new CommandLinePathParser(input, factory).parse("rackspace://u@cdn.cyberduck.ch/"));
        assertEquals(new Path("/", EnumSet.of(Path.Type.directory, Path.Type.volume)),
            new CommandLinePathParser(input, factory).parse("rackspace:///"));
    }