public void canonicalize(HandyURL url) { basic.canonicalize(url); ia.canonicalize(url); } }
public String unescapeRepeatedly(String input) { if (input == null) { return null; } while (true) { String un = decode(input); if (un.compareTo(input) == 0) { return input; } input = un; } }
public String minimalEscape(String input) { return escapeOnce(unescapeRepeatedly(input)); }
public void canonicalize(HandyURL url) { url.setHash(null); url.setAuthUser(minimalEscape(url.getAuthUser())); url.setAuthPass(minimalEscape(url.getAuthPass())); url.setQuery(minimalEscape(url.getQuery())); String hostE = unescapeRepeatedly(url.getHost()); String host = null; if (hostE != null) { ip = attemptIPFormats(host); if (ip != null) { host = ip; } else if (host != null) { host = escapeOnce(host.toLowerCase()); String path = unescapeRepeatedly(url.getPath()); url.setPath(escapeOnce(normalizePath(path)));
char c = input.charAt(i); if (i <= input.length() - 3 && c == '%' && (h1 = getHex(input.charAt(i + 1))) >= 0 && (h2 = getHex(input.charAt(i + 2))) >= 0) { if (sb == null) { sb = new StringBuilder(input.length()); if (pctUtf8SeqStart >= 0) { if (utf8decoder == null) { utf8decoder = UTF8().newDecoder(); appendDecodedPctUtf8(sb, bbuf, input, pctUtf8SeqStart, i, utf8decoder); pctUtf8SeqStart = -1; utf8decoder = UTF8().newDecoder(); appendDecodedPctUtf8(sb, bbuf, input, pctUtf8SeqStart, i, utf8decoder);
byte[] utf8bytes = input.getBytes(UTF8()); StringBuilder sb = null; boolean ok = false;
public void canonicalize(HandyURL url) { url.setHash(null); url.setAuthUser(minimalEscape(url.getAuthUser())); url.setAuthPass(minimalEscape(url.getAuthPass())); url.setQuery(minimalEscape(url.getQuery())); String hostE = unescapeRepeatedly(url.getHost()); String host = null; if (hostE != null) { ip = attemptIPFormats(host); if (ip != null) { host = ip; } else if (host != null) { host = escapeOnce(host.toLowerCase()); String path = unescapeRepeatedly(url.getPath()); url.setPath(escapeOnce(normalizePath(path)));
char c = input.charAt(i); if (i <= input.length() - 3 && c == '%' && (h1 = getHex(input.charAt(i + 1))) >= 0 && (h2 = getHex(input.charAt(i + 2))) >= 0) { if (sb == null) { sb = new StringBuilder(input.length()); if (pctUtf8SeqStart >= 0) { if (utf8decoder == null) { utf8decoder = UTF8().newDecoder(); appendDecodedPctUtf8(sb, bbuf, input, pctUtf8SeqStart, i, utf8decoder); pctUtf8SeqStart = -1; utf8decoder = UTF8().newDecoder(); appendDecodedPctUtf8(sb, bbuf, input, pctUtf8SeqStart, i, utf8decoder);
byte[] utf8bytes = input.getBytes(UTF8()); StringBuilder sb = null; boolean ok = false;
public void canonicalize(HandyURL url) { url.setHash(null); url.setAuthUser(minimalEscape(url.getAuthUser())); url.setAuthPass(minimalEscape(url.getAuthPass())); url.setQuery(minimalEscape(url.getQuery())); String hostE = unescapeRepeatedly(url.getHost()); String host = null; if (hostE != null) { ip = attemptIPFormats(host); if (ip != null) { host = ip; } else if (host != null) { host = escapeOnce(host.toLowerCase()); String path = unescapeRepeatedly(url.getPath()); url.setPath(escapeOnce(normalizePath(path)));
char c = input.charAt(i); if (i <= input.length() - 3 && c == '%' && (h1 = getHex(input.charAt(i + 1))) >= 0 && (h2 = getHex(input.charAt(i + 2))) >= 0) { if (sb == null) { sb = new StringBuilder(input.length()); if (pctUtf8SeqStart >= 0) { if (utf8decoder == null) { utf8decoder = UTF8().newDecoder(); appendDecodedPctUtf8(sb, bbuf, input, pctUtf8SeqStart, i, utf8decoder); pctUtf8SeqStart = -1; utf8decoder = UTF8().newDecoder(); appendDecodedPctUtf8(sb, bbuf, input, pctUtf8SeqStart, i, utf8decoder);
public String minimalEscape(String input) { return escapeOnce(unescapeRepeatedly(input)); }
public void canonicalize(HandyURL url) { // just google's stuff, followed by the IA default stuff: basic.canonicalize(url); ia.canonicalize(url); } }
public String unescapeRepeatedly(String input) { if (input == null) { return null; } while (true) { String un = decode(input); if (un.compareTo(input) == 0) { return input; } input = un; } }
byte[] utf8bytes = input.getBytes(UTF8()); StringBuilder sb = null; boolean ok = false;
public String minimalEscape(String input) { return escapeOnce(unescapeRepeatedly(input)); }
public void canonicalize(HandyURL url) { // just google's stuff, followed by the IA default stuff: basic.canonicalize(url); ia.canonicalize(url); } }
public String unescapeRepeatedly(String input) { if (input == null) { return null; } while (true) { String un = decode(input); if (un.compareTo(input) == 0) { return input; } input = un; } }
public void canonicalize(HandyURL url) { basic.canonicalize(url); ia.canonicalize(url); } }
public void canonicalize(HandyURL url) { // just google's stuff, followed by the IA default stuff: basic.canonicalize(url); ia.canonicalize(url); } }