/** * Construct a URIish from a standard URL. * * @param u * the source URL to convert from. */ public URIish(URL u) { scheme = u.getProtocol(); path = u.getPath(); path = cleanLeadingSlashes(path, scheme); try { rawPath = u.toURI().getRawPath(); rawPath = cleanLeadingSlashes(rawPath, scheme); } catch (URISyntaxException e) { throw new RuntimeException(e); // Impossible } final String ui = u.getUserInfo(); if (ui != null) { final int d = ui.indexOf(':'); user = d < 0 ? ui : ui.substring(0, d); pass = d < 0 ? null : ui.substring(d + 1); } port = u.getPort(); host = u.getHost(); }
if (matcher.matches()) { scheme = matcher.group(1); rawPath = cleanLeadingSlashes(matcher.group(2), scheme); path = unescape(rawPath); return; rawPath = cleanLeadingSlashes( n2e(matcher.group(4)) + ":" + portString //$NON-NLS-1$ + n2e(matcher.group(6)) + n2e(matcher.group(7)), port = Integer.parseInt(portString); rawPath = cleanLeadingSlashes( n2e(matcher.group(6)) + n2e(matcher.group(7)), scheme);
/** * Construct a URIish from a standard URL. * * @param u * the source URL to convert from. */ public URIish(final URL u) { scheme = u.getProtocol(); path = u.getPath(); path = cleanLeadingSlashes(path, scheme); try { rawPath = u.toURI().getRawPath(); rawPath = cleanLeadingSlashes(rawPath, scheme); } catch (URISyntaxException e) { throw new RuntimeException(e); // Impossible } final String ui = u.getUserInfo(); if (ui != null) { final int d = ui.indexOf(':'); user = d < 0 ? ui : ui.substring(0, d); pass = d < 0 ? null : ui.substring(d + 1); } port = u.getPort(); host = u.getHost(); }
/** * Construct a URIish from a standard URL. * * @param u * the source URL to convert from. */ public URIish(URL u) { scheme = u.getProtocol(); path = u.getPath(); path = cleanLeadingSlashes(path, scheme); try { rawPath = u.toURI().getRawPath(); rawPath = cleanLeadingSlashes(rawPath, scheme); } catch (URISyntaxException e) { throw new RuntimeException(e); // Impossible } final String ui = u.getUserInfo(); if (ui != null) { final int d = ui.indexOf(':'); user = d < 0 ? ui : ui.substring(0, d); pass = d < 0 ? null : ui.substring(d + 1); } port = u.getPort(); host = u.getHost(); }
if (matcher.matches()) { scheme = matcher.group(1); rawPath = cleanLeadingSlashes(matcher.group(2), scheme); path = unescape(rawPath); return; if (matcher.group(5) != null) port = Integer.parseInt(matcher.group(5)); rawPath = cleanLeadingSlashes( n2e(matcher.group(6)) + n2e(matcher.group(7)), scheme); path = unescape(rawPath);
if (matcher.matches()) { scheme = matcher.group(1); rawPath = cleanLeadingSlashes(matcher.group(2), scheme); path = unescape(rawPath); return; rawPath = cleanLeadingSlashes( n2e(matcher.group(4)) + ":" + portString //$NON-NLS-1$ + n2e(matcher.group(6)) + n2e(matcher.group(7)), port = Integer.parseInt(portString); rawPath = cleanLeadingSlashes( n2e(matcher.group(6)) + n2e(matcher.group(7)), scheme);