public class ClientUtils extends Object
Constructor and Description |
---|
ClientUtils() |
Modifier and Type | Method and Description |
---|---|
static com.sun.jersey.api.client.Client |
buildClient()
Builds a client component for interacting with HTTP endpoints.
|
static com.sun.jersey.api.client.Client |
buildClientWithProxy(String proxyHost,
int proxyPort)
Constructs a client component that uses a specified web proxy.
|
static com.sun.jersey.api.client.ClientRequest |
buildGetRequest(URI endpoint,
Map<String,String> qryParams,
javax.ws.rs.core.MediaType... mediaTypes)
Builds an HTTP request message that uses the GET method.
|
static Document |
getResponseEntityAsDocument(com.sun.jersey.api.client.ClientResponse response,
String targetURI)
Obtains the (XML) response entity as a DOM Document and resets the entity
input stream for subsequent reads.
|
static Source |
getResponseEntityAsSource(com.sun.jersey.api.client.ClientResponse response,
String targetURI)
Obtains the (XML) response entity as a JAXP Source object and resets the
entity input stream for subsequent reads.
|
static javax.ws.rs.core.MediaType |
removeParameters(javax.ws.rs.core.MediaType mediaType)
Creates a copy of the given MediaType object but without any parameters.
|
public static com.sun.jersey.api.client.Client buildClient()
public static com.sun.jersey.api.client.Client buildClientWithProxy(String proxyHost, int proxyPort)
proxyHost
- The host name or IP address of the proxy server.proxyPort
- The port number of the proxy listener.public static com.sun.jersey.api.client.ClientRequest buildGetRequest(URI endpoint, Map<String,String> qryParams, javax.ws.rs.core.MediaType... mediaTypes)
endpoint
- A URI indicating the target resource.qryParams
- A Map containing query parameters (may be null);mediaTypes
- A list of acceptable media types; if not specified,
generic XML ("application/xml") is preferred.public static javax.ws.rs.core.MediaType removeParameters(javax.ws.rs.core.MediaType mediaType)
mediaType
- A MediaType descriptor.public static Source getResponseEntityAsSource(com.sun.jersey.api.client.ClientResponse response, String targetURI)
response
- A representation of an HTTP response message.targetURI
- The target URI from which the entity was retrieved (may
be null).public static Document getResponseEntityAsDocument(com.sun.jersey.api.client.ClientResponse response, String targetURI)
response
- A representation of an HTTP response message.targetURI
- The target URI from which the entity was retrieved (may
be null).Copyright © 2024 Open Geospatial Consortium. All rights reserved.