/** * Sets the uri. * @param str the uri * @return the builder instance */ public RequestBuilder uri(String str) { try { uri(new URI(str)); } catch (URISyntaxException e) { throw new IllegalArgumentException("Exception parsing URI", e); } return this; }
/** * Sets the uri. * @param str the uri * @return the builder instance */ public RequestBuilder uri(String str) { try { uri(new URI(str)); } catch (URISyntaxException e) { throw new IllegalArgumentException("Exception parsing URI", e); } return this; }
/** * Sets the uri. * @param str the uri * @return the builder instance */ public RequestBuilder uri(String str) { try { uri(new URI(str)); } catch (URISyntaxException e) { throw new IllegalArgumentException("Exception parsing URI", e); } return this; }
/** * This method sets the path of the uri. * @param path the path after the port and for the query in a uri * @return the builder instance */ public RequestBuilder path(String path) { // Update URI with new path element URI existingUri = req.target().uri(); URI newUri; try { newUri = new URI( existingUri.getScheme(), existingUri.getUserInfo(), existingUri.getHost(), existingUri.getPort(), path, existingUri.getQuery(), existingUri.getFragment()); } catch (URISyntaxException e) { throw new IllegalArgumentException("New path couldn't be parsed", e); } uri(newUri); return this; }
/** * This method sets the path of the uri. * @param path the path after the port and for the query in a uri * @return the builder instance */ public RequestBuilder path(String path) { // Update URI with new path element URI existingUri = req.target().uri(); URI newUri; try { newUri = new URI( existingUri.getScheme(), existingUri.getUserInfo(), existingUri.getHost(), existingUri.getPort(), path, existingUri.getQuery(), existingUri.getFragment()); } catch (URISyntaxException e) { throw new IllegalArgumentException("New path couldn't be parsed", e); } uri(newUri); return this; }
/** * This method sets the path of the uri. * @param path the path after the port and for the query in a uri * @return the builder instance */ public RequestBuilder path(String path) { // Update URI with new path element URI existingUri = req.target().uri(); URI newUri; try { newUri = new URI( existingUri.getScheme(), existingUri.getUserInfo(), existingUri.getHost(), existingUri.getPort(), path, existingUri.getQuery(), existingUri.getFragment()); } catch (URISyntaxException e) { throw new IllegalArgumentException("New path couldn't be parsed", e); } uri(newUri); return this; }
/** * Sets the uri. * @param str the uri * @return the builder instance */ public RequestBuilder uri(String str) { try { uri(new URI(str)); } catch (URISyntaxException e) { throw new IllegalArgumentException("Exception parsing URI", e); } return this; }
/** * Returns a simple request builder, based on get and local address. */ public RequestBuilder() { method("GET"); uri("/"); host("localhost"); version("HTTP/1.1"); remoteAddress("127.0.0.1"); body(play.api.mvc.AnyContentAsEmpty$.MODULE$); }
/** * Builds a new fake request. * @param method the request method. * @param uri the relative URL. * @return the request builder. */ public static RequestBuilder fakeRequest(String method, String uri) { return new RequestBuilder().method(method).uri(uri); }
/** * Builds a new fake request. * @param method the request method. * @param uri the relative URL. * @return the request builder. */ public static RequestBuilder fakeRequest(String method, String uri) { return new RequestBuilder().method(method).uri(uri); }
/** * Build a new fake request. */ public static RequestBuilder fakeRequest(String method, String uri) { return new RequestBuilder().method(method).uri(uri); }