/** * Sets the user name that will be used in the request URL. * * @param user user name to use * @throws IllegalArgumentException if the user is empty * @throws NullPointerException if the user is null */ public void setUser(String user) { StringValidator.throwIfEmptyOrNull("user", user); this.user = user; }
/** * Sets the password to use in the request URL. This is ignored if there is no * user specified. * * @param password password to use in the request URL * * @throws IllegalArgumentException if the password is empty * @throws NullPointerException if the password is null */ public void setPassword(String password) { StringValidator.throwIfEmptyOrNull("password", password); this.password = password; }
/** * Creates a builder using the parameters values for configuration. * * @param httpMethod HTTP method to use for the request * @param url URL that has already has already been URL encoded. Please see * {@link com.google.gwt.http.client.URL#encode(String)} and * {@link com.google.gwt.http.client.URL#encodePathSegment(String)} and * {@link com.google.gwt.http.client.URL#encodeQueryString(String)} for * how to do this. * @throws IllegalArgumentException if the httpMethod or URL are empty * @throws NullPointerException if the httpMethod or the URL are null */ protected RequestBuilder(String httpMethod, String url) { StringValidator.throwIfEmptyOrNull("httpMethod", httpMethod); StringValidator.throwIfEmptyOrNull("url", url); this.httpMethod = httpMethod; this.url = url; }
/** * Sets a request header with the given name and value. If a header with the * specified name has already been set then the new value overwrites the * current value. * * @param header the name of the header * @param value the value of the header * * @throws NullPointerException if header or value are null * @throws IllegalArgumentException if header or value are the empty string */ public void setHeader(String header, String value) { StringValidator.throwIfEmptyOrNull("header", header); StringValidator.throwIfEmptyOrNull("value", value); if (headers == null) { headers = new HashMap<String, String>(); } headers.put(header, value); }
@Override public String getHeader(String header) { StringValidator.throwIfEmptyOrNull("header", header); return xmlHttpRequest.getResponseHeader(header); }
/** * Sets the user name that will be used in the request URL. * * @param user user name to use * @throws IllegalArgumentException if the user is empty * @throws NullPointerException if the user is null */ public void setUser(String user) { StringValidator.throwIfEmptyOrNull("user", user); this.user = user; }
/** * Sets the user name that will be used in the request URL. * * @param user user name to use * @throws IllegalArgumentException if the user is empty * @throws NullPointerException if the user is null */ public void setUser(String user) { StringValidator.throwIfEmptyOrNull("user", user); this.user = user; }
/** * Sets the password to use in the request URL. This is ignored if there is no * user specified. * * @param password password to use in the request URL * * @throws IllegalArgumentException if the password is empty * @throws NullPointerException if the password is null */ public void setPassword(String password) { StringValidator.throwIfEmptyOrNull("password", password); this.password = password; }
/** * Sets the password to use in the request URL. This is ignored if there is no * user specified. * * @param password password to use in the request URL * * @throws IllegalArgumentException if the password is empty * @throws NullPointerException if the password is null */ public void setPassword(String password) { StringValidator.throwIfEmptyOrNull("password", password); this.password = password; }
/** * Creates a builder using the parameters values for configuration. * * @param httpMethod HTTP method to use for the request * @param url URL that has already has already been URL encoded. Please see * {@link com.google.gwt.http.client.URL#encode(String)} and * {@link com.google.gwt.http.client.URL#encodePathSegment(String)} and * {@link com.google.gwt.http.client.URL#encodeQueryString(String)} for * how to do this. * @throws IllegalArgumentException if the httpMethod or URL are empty * @throws NullPointerException if the httpMethod or the URL are null */ protected RequestBuilder(String httpMethod, String url) { StringValidator.throwIfEmptyOrNull("httpMethod", httpMethod); StringValidator.throwIfEmptyOrNull("url", url); this.httpMethod = httpMethod; this.url = url; }
/** * Creates a builder using the parameters values for configuration. * * @param httpMethod HTTP method to use for the request * @param url URL that has already has already been URL encoded. Please see * {@link com.google.gwt.http.client.URL#encode(String)} and * {@link com.google.gwt.http.client.URL#encodePathSegment(String)} and * {@link com.google.gwt.http.client.URL#encodeQueryString(String)} for * how to do this. * @throws IllegalArgumentException if the httpMethod or URL are empty * @throws NullPointerException if the httpMethod or the URL are null */ protected RequestBuilder(String httpMethod, String url) { StringValidator.throwIfEmptyOrNull("httpMethod", httpMethod); StringValidator.throwIfEmptyOrNull("url", url); this.httpMethod = httpMethod; this.url = url; }
/** * Sets a request header with the given name and value. If a header with the * specified name has already been set then the new value overwrites the * current value. * * @param header the name of the header * @param value the value of the header * * @throws NullPointerException if header or value are null * @throws IllegalArgumentException if header or value are the empty string */ public void setHeader(String header, String value) { StringValidator.throwIfEmptyOrNull("header", header); StringValidator.throwIfEmptyOrNull("value", value); if (headers == null) { headers = new HashMap<String, String>(); } headers.put(header, value); }
/** * Sets a request header with the given name and value. If a header with the * specified name has already been set then the new value overwrites the * current value. * * @param header the name of the header * @param value the value of the header * * @throws NullPointerException if header or value are null * @throws IllegalArgumentException if header or value are the empty string */ public void setHeader(String header, String value) { StringValidator.throwIfEmptyOrNull("header", header); StringValidator.throwIfEmptyOrNull("value", value); if (headers == null) { headers = new HashMap<String, String>(); } headers.put(header, value); }
@Override public String getHeader(String header) { StringValidator.throwIfEmptyOrNull("header", header); return xmlHttpRequest.getResponseHeader(header); }
@Override public String getHeader(String header) { StringValidator.throwIfEmptyOrNull("header", header); return xmlHttpRequest.getResponseHeader(header); }