|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.biojava.bio.structure.align.util.HTTPConnectionTools
public class HTTPConnectionTools
a class that takes care about opening HttpURLConnections and sets the proper timeouts
| Field Summary | |
|---|---|
static int |
DEFAULT_CONNECTION_TIMEOUT
|
static java.lang.String |
USERAGENT
|
| Constructor Summary | |
|---|---|
HTTPConnectionTools()
|
|
| Method Summary | |
|---|---|
static java.io.InputStream |
doPOST(java.net.URL url,
java.lang.String data)
do a POST to a URL and return the response stream for further processing elsewhere. |
static java.io.InputStream |
doPOST(java.net.URL url,
java.lang.String data,
int timeout)
do a POST to a URL and return the response stream for further processing elsewhere. |
static java.io.InputStream |
getInputStream(java.net.URL url)
connect to DAS server and return result as an InputStream. |
static java.io.InputStream |
getInputStream(java.net.URL url,
boolean acceptGzipEncoding,
int timeout)
open a URL and return an InputStream to it if acceptGzipEncoding == true, use GZIPEncoding to compress communication |
static java.io.InputStream |
getInputStream(java.net.URL url,
int timeout)
connect to DAS server and return result as an InputStream. |
static java.net.HttpURLConnection |
openHttpURLConnection(java.net.URL url)
open HttpURLConnection. |
static java.net.HttpURLConnection |
openHttpURLConnection(java.net.URL url,
int timeout)
open HttpURLConnection. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String USERAGENT
public static final int DEFAULT_CONNECTION_TIMEOUT
| Constructor Detail |
|---|
public HTTPConnectionTools()
| Method Detail |
|---|
public static java.net.HttpURLConnection openHttpURLConnection(java.net.URL url,
int timeout)
throws java.io.IOException,
java.net.ConnectException
url - URL to oopentimeout - timeout in milli seconds
java.io.IOException
java.net.ConnectException
public static java.net.HttpURLConnection openHttpURLConnection(java.net.URL url)
throws java.io.IOException,
java.net.ConnectException
url - a URL to open a http connection to
java.io.IOException
java.net.ConnectException
public static java.io.InputStream getInputStream(java.net.URL url,
int timeout)
throws java.io.IOException
url - the URL to connect totimeout - the timeout for the connection
java.io.IOException
DASException - if DAS server returns error response code
public static java.io.InputStream getInputStream(java.net.URL url)
throws java.io.IOException
url - the URL to connect to
java.io.IOException
DASException - if DAS server returns error response code
public static java.io.InputStream getInputStream(java.net.URL url,
boolean acceptGzipEncoding,
int timeout)
throws java.io.IOException
url - acceptGzipEncoding -
java.io.IOException
DASException - if DAS server returns error response code
public static java.io.InputStream doPOST(java.net.URL url,
java.lang.String data)
throws java.io.IOException
url -
java.io.IOException
public static java.io.InputStream doPOST(java.net.URL url,
java.lang.String data,
int timeout)
throws java.io.IOException
url -
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||