/** * Encodes the form using the standard URI encoding mechanism and the UTF-8 * character set. * * @return The encoded form. * @throws IOException */ public String encode() throws IOException { return encode(CharacterSet.UTF_8); }
/** * URL encodes the form. The '&' character is used as a separator. * * @param characterSet * The supported character encoding. * @return The encoded form. * @throws IOException */ public String encode(CharacterSet characterSet) throws IOException { return encode(characterSet, '&'); }
/** * URL encodes the form. The '&' character is used as a separator. * * @param characterSet * The supported character encoding. * @return The encoded form. * @throws IOException */ public String encode(CharacterSet characterSet) throws IOException { return encode(characterSet, '&'); }
/** * Encodes the form using the standard URI encoding mechanism and the UTF-8 * character set. * * @return The encoded form. * @throws IOException */ public String encode() throws IOException { return encode(CharacterSet.UTF_8); }
/** * URL encodes the form. The '&' character is used as a separator. * * @param characterSet * The supported character encoding. * @return The encoded form. * @throws IOException */ public String encode(CharacterSet characterSet) throws IOException { return encode(characterSet, '&'); }
/** * Encodes the form using the standard URI encoding mechanism and the UTF-8 * character set. * * @return The encoded form. * @throws IOException */ public String encode() throws IOException { return encode(CharacterSet.UTF_8); }
/** * Formats the form as a query string. * * @param characterSet * The supported character encoding. * @return The form as a query string. */ public String getQueryString(CharacterSet characterSet) { try { return encode(characterSet); } catch (IOException ioe) { return null; } }
/** * Formats the form as a query string. * * @param characterSet * The supported character encoding. * @return The form as a query string. */ public String getQueryString(CharacterSet characterSet) { try { return encode(characterSet); } catch (IOException ioe) { return null; } }
/** * Formats the form as a query string. * * @param characterSet * The supported character encoding. * @return The form as a query string. */ public String getQueryString(CharacterSet characterSet) { try { return encode(characterSet); } catch (IOException ioe) { return null; } }
/** * Formats the form as a query string. * * @param characterSet * The supported character encoding. * @return The form as a matrix string. * @see <a href="http://www.w3.org/DesignIssues/MatrixURIs.html">Matrix URIs * by Tim Berners Lee</a> */ public String getMatrixString(CharacterSet characterSet) { try { return encode(characterSet, ';'); } catch (IOException ioe) { return null; } }
/** * Formats the form as a query string. * * @param characterSet * The supported character encoding. * @return The form as a matrix string. * @see <a href="http://www.w3.org/DesignIssues/MatrixURIs.html">Matrix URIs * by Tim Berners Lee</a> */ public String getMatrixString(CharacterSet characterSet) { try { return encode(characterSet, ';'); } catch (IOException ioe) { return null; } }
/** * Formats the form as a query string. * * @param characterSet * The supported character encoding. * @return The form as a matrix string. * @see <a href="http://www.w3.org/DesignIssues/MatrixURIs.html">Matrix URIs * by Tim Berners Lee</a> */ public String getMatrixString(CharacterSet characterSet) { try { return encode(characterSet, ';'); } catch (IOException ioe) { return null; } }
public Reference toReference(String uri) { String query; try { query = form.encode(); } catch (IOException ex) { Logger.getLogger(OAuthParameters.class.getName()).log(Level.SEVERE, null, ex); throw new ResourceException(ex); } Reference reference = new Reference(uri); reference.setQuery(query); return reference; }
/** * Sets the query value for the named parameter. If no query is defined, it * creates one. If the same parameter exists, it replaces it altogether. * * @param name * The query parameter name. * @param value * The query parameter value. */ public void setQueryValue(String name, String value) { Form query = getQuery(); if (query == null) { query = new Form(); } query.set(name, value); try { getReference().setQuery(query.encode()); } catch (IOException e) { getLogger().fine("Unable to set the query value"); } }