@Test public void parseDefaultHostnameWithUserRelativePath() throws Exception { final Host host = new HostParser(new ProtocolFactory(Collections.singleton(new TestProtocol(Scheme.https) { @Override public String getDefaultHostname() { return "defaultHostname"; } @Override public boolean isHostnameConfigurable() { return false; } }))).get("https: assertEquals("defaultHostname", host.getHostname()); assertEquals("user", host.getCredentials().getUsername()); assertEquals("folder/file", host.getDefaultPath()); }
public Host get(final String url) throws HostParserException { final Host parsed = HostParser.parse(factory, defaultScheme, url); if(log.isDebugEnabled()) { log.debug(String.format("Parsed %s as %s", url, parsed)); } return parsed; }
HostParser { public Host get(final String url) throws HostParserException { final Host parsed = HostParser.parse(factory, defaultScheme, url); if(log.isDebugEnabled()) { log.debug(String.format("Parsed %s as %s", url, parsed)); } return parsed; } }
HostParser { public Host get(final String url) throws HostParserException { final Host parsed = HostParser.parse(factory, defaultScheme, url); if(log.isDebugEnabled()) { log.debug(String.format("Parsed %s as %s", url, parsed)); } return parsed; } HostParser();  HostParser(final ProtocolFactory factory);  HostParser(final ProtocolFactory factory, final Protocol defaultScheme); }
HostParser { public Host get(final String url) throws HostParserException { final Host parsed = HostParser.parse(factory, defaultScheme, url); if(log.isDebugEnabled()) { log.debug(String.format("Parsed %s as %s", url, parsed)); } return parsed; } HostParser();  HostParser(final ProtocolFactory factory);  HostParser(final ProtocolFactory factory, final Protocol defaultScheme); Host get(final String url); static Host parse(final String url); }
HostParser { public Host get(final String url) throws HostParserException { final Host parsed = HostParser.parse(factory, defaultScheme, url); if(log.isDebugEnabled()) { log.debug(String.format("Parsed %s as %s", url, parsed)); } return parsed; } HostParser();  HostParser(final ProtocolFactory factory);  HostParser(final ProtocolFactory factory, final Protocol defaultScheme); Host get(final String url); static Host parse(final String url);  }