Normalize @param urlString The URL string to normalize. @param scope The given scope. @return A normalized String, using the given scope @throws MalformedURLException If the given URL string is malformed.
(String urlString, String scope)
| 305 | * If the given URL string is malformed. |
| 306 | */ |
| 307 | public String normalize(String urlString, String scope) |
| 308 | throws MalformedURLException { |
| 309 | // optionally loop several times, and break if no further changes |
| 310 | String initialString = urlString; |
| 311 | for (int k = 0; k < loopCount; k++) { |
| 312 | for (int i = 0; i < this.normalizers.length; i++) { |
| 313 | if (urlString == null) |
| 314 | return null; |
| 315 | urlString = this.normalizers[i].normalize(urlString, scope); |
| 316 | } |
| 317 | if (initialString.equals(urlString)) |
| 318 | break; |
| 319 | initialString = urlString; |
| 320 | } |
| 321 | return urlString; |
| 322 | } |
| 323 | } |