Returns a URI. @param href URL to send the request to (can be empty string) @param request request @return URI @throws QueryException query exception
(final byte[] href, final Request request)
| 106 | * @throws QueryException query exception |
| 107 | */ |
| 108 | private URI uri(final byte[] href, final Request request) throws QueryException { |
| 109 | final String uri = href.length == 0 ? request.attribute(HREF) : Token.string(href); |
| 110 | if(uri == null || uri.isEmpty()) throw HC_URL.get(info); |
| 111 | try { |
| 112 | return new URI(IOUrl.toAscii(uri)); |
| 113 | } catch(final URISyntaxException ex) { |
| 114 | Util.debug(ex); |
| 115 | throw HC_URI_X.get(info, uri); |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | /** |
| 120 | * Returns an HTTP response for the specified request. |