public abstract class AbstractDocumentGetRequest
extends java.lang.Object
XML document gets class.
Retrieve the XML document from the specified URI via the HTTP GET request method.
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
password
Visit the
serviceURL required password. |
protected java.lang.String |
serviceURL
can get the URI address of the XML document.
|
static java.lang.String |
URL_CHARSET
Edit the the URI address (
serviceURL ) by character set. |
protected java.lang.String |
userName
Access the user name required for
serviceURL . |
Modifier | Constructor and Description |
---|---|
protected |
AbstractDocumentGetRequest(java.lang.String serviceURL, java.lang.String userName, java.lang.String password)
Constructs an object AbstractDocumentGetRequest through the URI address, user name, and password.
|
Modifier and Type | Method and Description |
---|---|
protected void |
appendKVP(java.lang.StringBuffer sbToAdd, java.lang.String key, java.lang.String value)
Add a keyword-value pair after specifying the string buffer, formatted like "& key = value", where key is the keyword and value is the value.
|
protected void |
appendKVP(java.lang.StringBuffer sbToAdd, java.lang.String key, java.lang.String[] values)
@return statistics rusult.
|
protected org.w3c.dom.Document |
getDocument(java.lang.String url, java.lang.String userName, java.lang.String psd)
@return statistics rusult.
|
protected final java.lang.String serviceURL
can get the URI address of the XML document.
protected final java.lang.String userName
Access the user name required for serviceURL
.
protected final java.lang.String password
Visit the serviceURL
required password.
public static final java.lang.String URL_CHARSET
Edit the the URI address (serviceURL
) by character set.
protected AbstractDocumentGetRequest(java.lang.String serviceURL, java.lang.String userName, java.lang.String password)
Constructs an object AbstractDocumentGetRequest through the URI address, user name, and password.
serviceURL
- can get the URI address of the XML document.userName
- username.password
- password.protected void appendKVP(java.lang.StringBuffer sbToAdd, java.lang.String key, java.lang.String value)
Add a keyword-value pair after specifying the string buffer, formatted like "& key = value", where key is the keyword and value is the value.
Used to add the request parameter after the URI, where key is the parameter name, value is the parameter value, value will encode using the URLEncoder
object, with the character set URL_CHARSET
, and if the encoding fails, add the original value.
sbToAdd
- save the string buffer for the URI.key
- parameter name.value
- parameter value.protected void appendKVP(java.lang.StringBuffer sbToAdd, java.lang.String key, java.lang.String[] values)
@return statistics rusult. Add a keyword-value pair after specifying the string buffer, formatted like "& key = value", where key is the keyword and value is the value.
Used to add the request parameter after the URI, where key is the parameter name, value is the parameter value, value will encode using the URLEncoder
object, with the character set URL_CHARSET
, and if the encoding fails, add the original value.
sbToAdd
- save the string buffer for the URI.key
- parameter name.value
- parameter value.protected org.w3c.dom.Document getDocument(java.lang.String url, java.lang.String userName, java.lang.String psd) throws HttpException, java.io.IOException
@return statistics rusult. Retrieve the XML document from the specified URI via the HTTP GET request method.
url
- The address of the document URL.userName
- The user name, if not needed, can be empty (null or "").psd
- The password, if not needed, can be empty (null or "").HttpException
- HTTP request exception.java.io.IOException
- Input / output exception.