public class Util
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BES_PROTOCOL |
static java.lang.String |
HTTP_PROTOCOL |
static java.lang.String |
HTTPS_PROTOCOL |
Constructor and Description |
---|
Util() |
Modifier and Type | Method and Description |
---|---|
static void |
forwardUrlContent(java.lang.String url,
org.apache.http.client.CredentialsProvider credentialsProvider,
javax.servlet.http.HttpServletResponse response,
boolean transferHttpHeaders)
Copies the content of the remote resource into the passed HttpServletResponse instance.
|
static org.apache.http.client.CredentialsProvider |
getNetRCCredentialsProvider() |
static org.apache.http.client.CredentialsProvider |
getNetRCCredentialsProvider(java.lang.String filename,
boolean secure_transport) |
static void |
writeRemoteContent(java.lang.String url,
org.apache.http.client.CredentialsProvider _credsProvider,
java.io.OutputStream os)
Retrieves the resource located at "url" and writes its content into "os".
|
public static final java.lang.String HTTP_PROTOCOL
public static final java.lang.String HTTPS_PROTOCOL
public static final java.lang.String BES_PROTOCOL
public static org.apache.http.client.CredentialsProvider getNetRCCredentialsProvider() throws java.io.IOException
java.io.IOException
public static org.apache.http.client.CredentialsProvider getNetRCCredentialsProvider(java.lang.String filename, boolean secure_transport) throws java.io.IOException
java.io.IOException
public static void writeRemoteContent(java.lang.String url, org.apache.http.client.CredentialsProvider _credsProvider, java.io.OutputStream os) throws java.io.IOException
url
- Resource to retrieve._credsProvider
- Authenitcation credentials used to access "url"os
- Writes the stuff to this sink.java.io.IOException
public static void forwardUrlContent(java.lang.String url, org.apache.http.client.CredentialsProvider credentialsProvider, javax.servlet.http.HttpServletResponse response, boolean transferHttpHeaders) throws java.io.IOException
url
- The remote resource to retrievecredentialsProvider
- Credentials to be used if authentication is requiredresponse
- The HttpServletResponse object which contains the destination OutputStream and the API for setting
response headers in the Tomcat/Servlet API ecosystem.transferHttpHeaders
- If set to true the remote resource's HTTP response heders will be transfered. If false
then the remote resource response hedaers will be ignored.java.io.IOException
- When bad things happen.
\