@Test public void testParseRootlessWithUser() throws HostParserException { final Host host = new Host(new TestProtocol() { @Override public boolean isHostnameConfigurable() { return false; } }); final String path = "user@path/sub/directory"; final HostParser.StringReader reader = new HostParser.StringReader(path); HostParser.parseRootless(reader, host); assertEquals("user", host.getCredentials().getUsername()); assertEquals("path/sub/directory", host.getDefaultPath()); }
static void parseRootless(final StringReader reader, final Host host) throws HostParserException { final boolean userInfoResult = parseUserInfo(reader, host); if(host.getProtocol().isHostnameConfigurable() && StringUtils.isWhitespace(host.getHostname())) { parseHostname(reader, host); } parsePath(reader, host, false); }
HostParser { static void parseRootless(final StringReader reader, final Host host) throws HostParserException { final boolean userInfoResult = parseUserInfo(reader, host); if(host.getProtocol().isHostnameConfigurable() && StringUtils.isWhitespace(host.getHostname())) { parseHostname(reader, host); } parsePath(reader, host, false); } }
HostParser { static void parseRootless(final StringReader reader, final Host host) throws HostParserException { final boolean userInfoResult = parseUserInfo(reader, host); if(host.getProtocol().isHostnameConfigurable() && StringUtils.isWhitespace(host.getHostname())) { parseHostname(reader, host); } parsePath(reader, host, false); } HostParser();  HostParser(final ProtocolFactory factory);  HostParser(final ProtocolFactory factory, final Protocol defaultScheme); }
HostParser { static void parseRootless(final StringReader reader, final Host host) throws HostParserException { final boolean userInfoResult = parseUserInfo(reader, host); if(host.getProtocol().isHostnameConfigurable() && StringUtils.isWhitespace(host.getHostname())) { parseHostname(reader, host); } parsePath(reader, host, false); } HostParser();  HostParser(final ProtocolFactory factory);  HostParser(final ProtocolFactory factory, final Protocol defaultScheme); Host get(final String url); static Host parse(final String url); }
HostParser { static void parseRootless(final StringReader reader, final Host host) throws HostParserException { final boolean userInfoResult = parseUserInfo(reader, host); if(host.getProtocol().isHostnameConfigurable() && StringUtils.isWhitespace(host.getHostname())) { parseHostname(reader, host); } parsePath(reader, host, false); } HostParser();  HostParser(final ProtocolFactory factory);  HostParser(final ProtocolFactory factory, final Protocol defaultScheme); Host get(final String url); static Host parse(final String url);  }