org.apache.commons.httpclient.URI.parseUriReference()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(11.4k)|赞(0)|评价(0)|浏览(96)

本文整理了Java中org.apache.commons.httpclient.URI.parseUriReference()方法的一些代码示例,展示了URI.parseUriReference()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。URI.parseUriReference()方法的具体详情如下:
包路径:org.apache.commons.httpclient.URI
类名称:URI
方法名:parseUriReference

URI.parseUriReference介绍

[英]In order to avoid any possilbity of conflict with non-ASCII characters, Parse a URI reference as a String with the character encoding of the local system or the document.

The following line is the regular expression for breaking-down a URI reference into its components.

^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))? 
12            3  4          5       6  7        8 9

For example, matching the above expression to http://jakarta.apache.org/ietf/uri/#Related results in the following subexpression matches:

$1 = http: 
scheme    =  $2 = http 
$3 = //jakarta.apache.org 
authority =  $4 = jakarta.apache.org 
path      =  $5 = /ietf/uri/ 
$6 =  
query     =  $7 =  
$8 = #Related 
fragment  =  $9 = Related

[中]为了避免与非ASCII字符发生冲突,请使用本地系统或文档的字符编码将URI引用解析为String
下面一行是将URI引用分解为其组件的正则表达式。

^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))? 
12            3  4          5       6  7        8 9

例如,将上述表达式与http://jakarta.apache.org/ietf/uri/#Related导致以下子表达式匹配:

$1 = http: 
scheme    =  $2 = http 
$3 = //jakarta.apache.org 
authority =  $4 = jakarta.apache.org 
path      =  $5 = /ietf/uri/ 
$6 =  
query     =  $7 =  
$8 = #Related 
fragment  =  $9 = Related

代码示例

代码示例来源:origin: commons-httpclient/commons-httpclient

/**
 * Construct a URI from the given string with the given charset.
 *
 * @param original the string to be represented to URI character sequence
 * It is one of absoluteURI and relativeURI.
 * @param charset the charset string to do escape encoding
 * @throws URIException If the URI cannot be created.
 * @see #getProtocolCharset
 * 
 * @deprecated Use #URI(String, boolean, String)
 */
public URI(String original, String charset) throws URIException {
  protocolCharset = charset;
  parseUriReference(original, false);
}

代码示例来源:origin: commons-httpclient/commons-httpclient

/**
 * Construct a URI from the given string.
 * <p><blockquote><pre>
 *   URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
 * </pre></blockquote><p>
 * An URI can be placed within double-quotes or angle brackets like 
 * "http://test.com/" and &lt;http://test.com/&gt;
 *
 * @param original the string to be represented to URI character sequence
 * It is one of absoluteURI and relativeURI.
 * @throws URIException If the URI cannot be created.
 * @see #getDefaultProtocolCharset
 * 
 * @deprecated Use #URI(String, boolean)
 */
public URI(String original) throws URIException {
  parseUriReference(original, false);
}

代码示例来源:origin: commons-httpclient/commons-httpclient

/**
 * Construct a URI from a string with the given charset. The input string can 
 * be either in escaped or unescaped form. 
 *
 * @param s URI character sequence
 * @param escaped <tt>true</tt> if URI character sequence is in escaped form. 
 *                <tt>false</tt> otherwise. 
 * 
 * @throws URIException If the URI cannot be created.
 * @throws NullPointerException if input string is <code>null</code>
 * 
 * @see #getProtocolCharset
 * 
 * @since 3.0
 */
public URI(String s, boolean escaped)
  throws URIException, NullPointerException {
  parseUriReference(s, escaped);
}

代码示例来源:origin: commons-httpclient/commons-httpclient

/**
 * Construct a URI from a string with the given charset. The input string can 
 * be either in escaped or unescaped form. 
 *
 * @param s URI character sequence
 * @param escaped <tt>true</tt> if URI character sequence is in escaped form. 
 *                <tt>false</tt> otherwise. 
 * @param charset the charset string to do escape encoding, if required
 * 
 * @throws URIException If the URI cannot be created.
 * @throws NullPointerException if input string is <code>null</code>
 * 
 * @see #getProtocolCharset
 * 
 * @since 3.0
 */
public URI(String s, boolean escaped, String charset)
  throws URIException, NullPointerException {
  protocolCharset = charset;
  parseUriReference(s, escaped);
}

代码示例来源:origin: commons-httpclient/commons-httpclient

/**
 * Construct a URI as an escaped form of a character array.
 * An URI can be placed within double-quotes or angle brackets like 
 * "http://test.com/" and &lt;http://test.com/&gt;
 * 
 * @param escaped the URI character sequence
 * @throws URIException If the URI cannot be created.
 * @throws NullPointerException if <code>escaped</code> is <code>null</code>
 * @see #getDefaultProtocolCharset
 * 
 * @deprecated Use #URI(String, boolean)
 */
public URI(char[] escaped) 
  throws URIException, NullPointerException {
  parseUriReference(new String(escaped), true);
}

代码示例来源:origin: commons-httpclient/commons-httpclient

/**
 * Construct a URI as an escaped form of a character array with the given
 * charset.
 *
 * @param escaped the URI character sequence
 * @param charset the charset string to do escape encoding
 * @throws URIException If the URI cannot be created.
 * @throws NullPointerException if <code>escaped</code> is <code>null</code>
 * @see #getProtocolCharset
 * 
 * @deprecated Use #URI(String, boolean, String)
 */
public URI(char[] escaped, String charset) 
  throws URIException, NullPointerException {
  protocolCharset = charset;
  parseUriReference(new String(escaped), true);
}

代码示例来源:origin: commons-httpclient/commons-httpclient

buff.append(fragment);
parseUriReference(buff.toString(), false);

代码示例来源:origin: commons-httpclient/commons-httpclient

parseUriReference(new String(_uri), true);

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.httpclient

/**
 * Construct a URI from the given string with the given charset.
 *
 * @param original the string to be represented to URI character sequence
 * It is one of absoluteURI and relativeURI.
 * @param charset the charset string to do escape encoding
 * @throws URIException If the URI cannot be created.
 * @see #getProtocolCharset
 * 
 * @deprecated Use #URI(String, boolean, String)
 */
public URI(String original, String charset) throws URIException {
  protocolCharset = charset;
  parseUriReference(original, false);
}

代码示例来源:origin: org.wso2.commons-httpclient/commons-httpclient

/**
 * Construct a URI from the given string with the given charset.
 *
 * @param original the string to be represented to URI character sequence
 * It is one of absoluteURI and relativeURI.
 * @param charset the charset string to do escape encoding
 * @throws URIException If the URI cannot be created.
 * @see #getProtocolCharset
 * 
 * @deprecated Use #URI(String, boolean, String)
 */
public URI(String original, String charset) throws URIException {
  protocolCharset = charset;
  parseUriReference(original, false);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient

/**
 * Construct a URI from the given string with the given charset.
 *
 * @param original the string to be represented to URI character sequence
 * It is one of absoluteURI and relativeURI.
 * @param charset the charset string to do escape encoding
 * @throws URIException If the URI cannot be created.
 * @see #getProtocolCharset
 * 
 * @deprecated Use #URI(String, boolean, String)
 */
public URI(String original, String charset) throws URIException {
  protocolCharset = charset;
  parseUriReference(original, false);
}

代码示例来源:origin: org.apache.commons/httpclient

/**
 * Construct a URI from the given string with the given charset.
 *
 * @param original the string to be represented to URI character sequence
 * It is one of absoluteURI and relativeURI.
 * @param charset the charset string to do escape encoding
 * @throws URIException If the URI cannot be created.
 * @see #getProtocolCharset
 * 
 * @deprecated Use #URI(String, boolean, String)
 */
public URI(String original, String charset) throws URIException {
  protocolCharset = charset;
  parseUriReference(original, false);
}

代码示例来源:origin: org.apache.commons/httpclient

/**
 * Construct a URI as an escaped form of a character array.
 * An URI can be placed within double-quotes or angle brackets like 
 * "http://test.com/" and &lt;http://test.com/&gt;
 * 
 * @param escaped the URI character sequence
 * @throws URIException If the URI cannot be created.
 * @throws NullPointerException if <code>escaped</code> is <code>null</code>
 * @see #getDefaultProtocolCharset
 * 
 * @deprecated Use #URI(String, boolean)
 */
public URI(char[] escaped) 
  throws URIException, NullPointerException {
  parseUriReference(new String(escaped), true);
}

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.httpclient

/**
 * Construct a URI as an escaped form of a character array.
 * An URI can be placed within double-quotes or angle brackets like 
 * "http://test.com/" and &lt;http://test.com/&gt;
 * 
 * @param escaped the URI character sequence
 * @throws URIException If the URI cannot be created.
 * @throws NullPointerException if <code>escaped</code> is <code>null</code>
 * @see #getDefaultProtocolCharset
 * 
 * @deprecated Use #URI(String, boolean)
 */
public URI(char[] escaped) 
  throws URIException, NullPointerException {
  parseUriReference(new String(escaped), true);
}

代码示例来源:origin: org.zaproxy/zap

/**
 * Construct a URI from the given string with the given charset.
 *
 * @param original the string to be represented to URI character sequence
 * It is one of absoluteURI and relativeURI.
 * @param charset the charset string to do escape encoding
 * @throws URIException If the URI cannot be created.
 * @see #getProtocolCharset
 * 
 * @deprecated Use #URI(String, boolean, String)
 */
@Deprecated
public URI(String original, String charset) throws URIException {
  protocolCharset = charset;
  parseUriReference(original, false);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient

/**
 * Construct a URI as an escaped form of a character array.
 * An URI can be placed within double-quotes or angle brackets like 
 * "http://test.com/" and &lt;http://test.com/&gt;
 * 
 * @param escaped the URI character sequence
 * @throws URIException If the URI cannot be created.
 * @throws NullPointerException if <code>escaped</code> is <code>null</code>
 * @see #getDefaultProtocolCharset
 * 
 * @deprecated Use #URI(String, boolean)
 */
public URI(char[] escaped) 
  throws URIException, NullPointerException {
  parseUriReference(new String(escaped), true);
}

代码示例来源:origin: org.wso2.commons-httpclient/commons-httpclient

/**
 * Construct a URI as an escaped form of a character array.
 * An URI can be placed within double-quotes or angle brackets like 
 * "http://test.com/" and &lt;http://test.com/&gt;
 * 
 * @param escaped the URI character sequence
 * @throws URIException If the URI cannot be created.
 * @throws NullPointerException if <code>escaped</code> is <code>null</code>
 * @see #getDefaultProtocolCharset
 * 
 * @deprecated Use #URI(String, boolean)
 */
public URI(char[] escaped) 
  throws URIException, NullPointerException {
  parseUriReference(new String(escaped), true);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient

/**
 * Construct a URI as an escaped form of a character array with the given
 * charset.
 *
 * @param escaped the URI character sequence
 * @param charset the charset string to do escape encoding
 * @throws URIException If the URI cannot be created.
 * @throws NullPointerException if <code>escaped</code> is <code>null</code>
 * @see #getProtocolCharset
 * 
 * @deprecated Use #URI(String, boolean, String)
 */
public URI(char[] escaped, String charset) 
  throws URIException, NullPointerException {
  protocolCharset = charset;
  parseUriReference(new String(escaped), true);
}

代码示例来源:origin: org.apache.commons/httpclient

/**
 * Construct a URI as an escaped form of a character array with the given
 * charset.
 *
 * @param escaped the URI character sequence
 * @param charset the charset string to do escape encoding
 * @throws URIException If the URI cannot be created.
 * @throws NullPointerException if <code>escaped</code> is <code>null</code>
 * @see #getProtocolCharset
 * 
 * @deprecated Use #URI(String, boolean, String)
 */
public URI(char[] escaped, String charset) 
  throws URIException, NullPointerException {
  protocolCharset = charset;
  parseUriReference(new String(escaped), true);
}

代码示例来源:origin: org.zaproxy/zap

/**
 * Construct a URI as an escaped form of a character array with the given
 * charset.
 *
 * @param escaped the URI character sequence
 * @param charset the charset string to do escape encoding
 * @throws URIException If the URI cannot be created.
 * @throws NullPointerException if <code>escaped</code> is <code>null</code>
 * @see #getProtocolCharset
 * 
 * @deprecated Use #URI(String, boolean, String)
 */
@Deprecated
public URI(char[] escaped, String charset) 
  throws URIException, NullPointerException {
  protocolCharset = charset;
  parseUriReference(new String(escaped), true);
}

相关文章