@Test public void rfc3986_pathEncodingRequired() { assertEquals("%00", PercentEncoder.encodePathSegment("\u0000")); assertEquals("%01", PercentEncoder.encodePathSegment("\u0001")); assertEquals("%02", PercentEncoder.encodePathSegment("\u0002")); assertEquals("%03", PercentEncoder.encodePathSegment("\u0003")); assertEquals("%04", PercentEncoder.encodePathSegment("\u0004")); assertEquals("%05", PercentEncoder.encodePathSegment("\u0005")); assertEquals("%06", PercentEncoder.encodePathSegment("\u0006")); assertEquals("%07", PercentEncoder.encodePathSegment("\u0007")); assertEquals("%08", PercentEncoder.encodePathSegment("\u0008")); assertEquals("%09", PercentEncoder.encodePathSegment("\u0009")); assertEquals("%0A", PercentEncoder.encodePathSegment("\n")); assertEquals("%0B", PercentEncoder.encodePathSegment("\u000b")); assertEquals("%0C", PercentEncoder.encodePathSegment("\u000c")); assertEquals("%0D", PercentEncoder.encodePathSegment("\r")); assertEquals("%0E", PercentEncoder.encodePathSegment("\u000e")); assertEquals("%0F", PercentEncoder.encodePathSegment("\u000f")); assertEquals("%10", PercentEncoder.encodePathSegment("\u0010")); assertEquals("%11", PercentEncoder.encodePathSegment("\u0011")); assertEquals("%12", PercentEncoder.encodePathSegment("\u0012")); assertEquals("%13", PercentEncoder.encodePathSegment("\u0013")); assertEquals("%14", PercentEncoder.encodePathSegment("\u0014")); assertEquals("%15", PercentEncoder.encodePathSegment("\u0015")); assertEquals("%16", PercentEncoder.encodePathSegment("\u0016")); assertEquals("%17", PercentEncoder.encodePathSegment("\u0017")); assertEquals("%18", PercentEncoder.encodePathSegment("\u0018")); assertEquals("%19", PercentEncoder.encodePathSegment("\u0019")); assertEquals("%1A", PercentEncoder.encodePathSegment("\u001a")); assertEquals("%1B", PercentEncoder.encodePathSegment("\u001b")); assertEquals("%1C", PercentEncoder.encodePathSegment("\u001c")); assertEquals("%1D", PercentEncoder.encodePathSegment("\u001d")); assertEquals("%1E", PercentEncoder.encodePathSegment("\u001e")); assertEquals("%1F", PercentEncoder.encodePathSegment("\u001f")); assertEquals("%20", PercentEncoder.encodePathSegment("\u0020")); assertEquals("%22", PercentEncoder.encodePathSegment("\"")); assertEquals("%23", PercentEncoder.encodePathSegment("#")); assertEquals("%25", PercentEncoder.encodePathSegment("%")); assertEquals("%2F", PercentEncoder.encodePathSegment("/")); assertEquals("%3C", PercentEncoder.encodePathSegment("<")); assertEquals("%3E", PercentEncoder.encodePathSegment(">")); assertEquals("%3F", PercentEncoder.encodePathSegment("?")); assertEquals("%5B", PercentEncoder.encodePathSegment("[")); assertEquals("%5C", PercentEncoder.encodePathSegment("\\")); assertEquals("%5D", PercentEncoder.encodePathSegment("]")); assertEquals("%5E", PercentEncoder.encodePathSegment("^")); assertEquals("%60", PercentEncoder.encodePathSegment("`")); assertEquals("%7B", PercentEncoder.encodePathSegment("{")); assertEquals("%7C", PercentEncoder.encodePathSegment("|")); assertEquals("%7D", PercentEncoder.encodePathSegment("}")); assertEquals("%7F", PercentEncoder.encodePathSegment("\u007f")); }
public static String encodePathSegment(String segment) { return PercentEncoder.encode(segment, safePath, false, false); }
PercentEncoder { public static String encodePathSegment(String segment) { return PercentEncoder.encode(segment, safePath, false, false); } }
PercentEncoder { public static String encodePathSegment(String segment) { return PercentEncoder.encode(segment, safePath, false, false); }  }
PercentEncoder { public static String encodePathSegment(String segment) { return PercentEncoder.encode(segment, safePath, false, false); }  static String encodePathSegment(String segment); static String encodeQueryComponent(String component); static String encodeQueryComponentNoPlusForSpace(String component); static String encodeFragment(String fragment); static String reEncodePath(String path); static String reEncodeQuery(String query); static String reEncodeFragment(String fragment); }
PercentEncoder { public static String encodePathSegment(String segment) { return PercentEncoder.encode(segment, safePath, false, false); }  static String encodePathSegment(String segment); static String encodeQueryComponent(String component); static String encodeQueryComponentNoPlusForSpace(String component); static String encodeFragment(String fragment); static String reEncodePath(String path); static String reEncodeQuery(String query); static String reEncodeFragment(String fragment);  }