class CommandLineUriParser {

    public Host parse(final String uri) throws HostParserException {
        final Host host = new HostParser(factory).get(uri);
        if(input.hasOption(TerminalOptionsBuilder.Params.region.name())) {
            host.setRegion(input.getOptionValue(TerminalOptionsBuilder.Params.region.name()));
        }
        final Path directory = new CommandLinePathParser(input, factory).parse(uri);
        if(directory.isDirectory()) {
            host.setDefaultPath(directory.getAbsolute());
        }
        else {
            host.setDefaultPath(directory.getParent().getAbsolute());
        }
        if(input.hasOption(TerminalOptionsBuilder.Params.udt.name())) {
            host.setTransfer(Host.TransferType.udt);
        }
        if(log.isDebugEnabled()) {
            log.debug(String.format("Parsed %s as %s", uri, host));
        }
        return host;
    }

    public  CommandLineUriParser(final CommandLine input);
    public  CommandLineUriParser(final CommandLine input, final ProtocolFactory factory);

}