(String input)
| 2023 | |
| 2024 | |
| 2025 | private String removePathParameters(String input) { |
| 2026 | int nextSemiColon = input.indexOf(';'); |
| 2027 | // Shortcut |
| 2028 | if (nextSemiColon == -1) { |
| 2029 | return input; |
| 2030 | } |
| 2031 | StringBuilder result = new StringBuilder(input.length()); |
| 2032 | result.append(input, 0, nextSemiColon); |
| 2033 | while (true) { |
| 2034 | int nextSlash = input.indexOf('/', nextSemiColon); |
| 2035 | if (nextSlash == -1) { |
| 2036 | break; |
| 2037 | } |
| 2038 | nextSemiColon = input.indexOf(';', nextSlash); |
| 2039 | if (nextSemiColon == -1) { |
| 2040 | result.append(input.substring(nextSlash)); |
| 2041 | break; |
| 2042 | } else { |
| 2043 | result.append(input, nextSlash, nextSemiColon); |
| 2044 | } |
| 2045 | } |
| 2046 | |
| 2047 | return result.toString(); |
| 2048 | } |
| 2049 | |
| 2050 | |
| 2051 | private int nextSlash(char[] uri, int startPos) { |
no test coverage detected