Class AbstractDocumentGetRequest
- java.lang.Object
-
- com.supermap.services.providers.AbstractDocumentGetRequest
-
- Direct Known Subclasses:
- AbstractCapabilitiesRequest, AbstractFeatureTypeRequest, AbstractGetFeatureRequest
public abstract class AbstractDocumentGetRequest extends java.lang.ObjectXML document gets class.
Retrieve the XML document from the specified URI via the HTTP GET request method.
-
-
Field Summary
Fields Modifier and Type Field and Description protected java.lang.StringpasswordVisit theserviceURLrequired password.protected java.lang.StringserviceURLcan get the URI address of the XML document.static java.lang.StringURL_CHARSETEdit the the URI address (serviceURL) by character set.protected java.lang.StringuserNameAccess the user name required forserviceURL.
-
Constructor Summary
Constructors Modifier Constructor and Description protectedAbstractDocumentGetRequest(java.lang.String serviceURL, java.lang.String userName, java.lang.String password)Constructs an object AbstractDocumentGetRequest through the URI address, user name, and password.
-
Method Summary
Methods Modifier and Type Method and Description protected voidappendKVP(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 voidappendKVP(java.lang.StringBuffer sbToAdd, java.lang.String key, java.lang.String[] values)@return statistics rusult.protected org.w3c.dom.DocumentgetDocument(java.lang.String url, java.lang.String userName, java.lang.String psd)@return statistics rusult.
-
-
-
Field Detail
-
serviceURL
protected final java.lang.String serviceURL
can get the URI address of the XML document.
-
userName
protected final java.lang.String userName
Access the user name required for
serviceURL.
-
password
protected final java.lang.String password
Visit the
serviceURLrequired password.
-
URL_CHARSET
public static final java.lang.String URL_CHARSET
Edit the the URI address (
serviceURL) by character set.
-
-
Constructor Detail
-
AbstractDocumentGetRequest
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.
- Parameters:
serviceURL- can get the URI address of the XML document.userName- username.password- password.
-
-
Method Detail
-
appendKVP
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
URLEncoderobject, with the character setURL_CHARSET, and if the encoding fails, add the original value.- Parameters:
sbToAdd- save the string buffer for the URI.key- parameter name.value- parameter value.
-
appendKVP
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
URLEncoderobject, with the character setURL_CHARSET, and if the encoding fails, add the original value.- Parameters:
sbToAdd- save the string buffer for the URI.key- parameter name.value- parameter value.
-
getDocument
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.
- Parameters:
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 "").- Returns:
- XML document.
- Throws:
HttpException- HTTP request exception.java.io.IOException- Input / output exception.
-
-