Parses an RFC 3986 URI. @param uri the URI to parse @return parsed URI
(final String uri)
| 180 | * @return parsed URI |
| 181 | */ |
| 182 | public static ParsedUri parse(final String uri) { |
| 183 | final Matcher matcher = URI_REF.matcher(uri); |
| 184 | try { |
| 185 | if(uri.length() <= 2048 && matcher.matches()) { |
| 186 | final ParsedUri pu = new ParsedUri(); |
| 187 | pu.absolute = matcher.group("scheme") != null; |
| 188 | pu.valid = true; |
| 189 | return pu; |
| 190 | } |
| 191 | } catch(final StackOverflowError er) { |
| 192 | Util.debug(er); |
| 193 | } |
| 194 | return ParsedUri.INVALID; |
| 195 | } |
| 196 | |
| 197 | /** |
| 198 | * URI data. |