|
|||||||||
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 String |
USERAGENT
|
Constructor Summary | |
---|---|
HTTPConnectionTools()
|
Method Summary | |
---|---|
static InputStream |
doPOST(URL url,
String data)
do a POST to a URL and return the response stream for further processing elsewhere. |
static InputStream |
doPOST(URL url,
String data,
int timeout)
do a POST to a URL and return the response stream for further processing elsewhere. |
static InputStream |
getInputStream(URL url)
connect to DAS server and return result as an InputStream. |
static InputStream |
getInputStream(URL url,
boolean acceptGzipEncoding,
int timeout)
open a URL and return an InputStream to it if acceptGzipEncoding == true, use GZIPEncoding to compress communication |
static InputStream |
getInputStream(URL url,
int timeout)
connect to DAS server and return result as an InputStream. |
static HttpURLConnection |
openHttpURLConnection(URL url)
open HttpURLConnection. |
static HttpURLConnection |
openHttpURLConnection(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 String USERAGENT
public static final int DEFAULT_CONNECTION_TIMEOUT
Constructor Detail |
---|
public HTTPConnectionTools()
Method Detail |
---|
public static HttpURLConnection openHttpURLConnection(URL url, int timeout) throws IOException, ConnectException
url
- URL to oopentimeout
- timeout in milli seconds
IOException
ConnectException
public static HttpURLConnection openHttpURLConnection(URL url) throws IOException, ConnectException
url
- a URL to open a http connection to
IOException
ConnectException
public static InputStream getInputStream(URL url, int timeout) throws IOException
url
- the URL to connect totimeout
- the timeout for the connection
IOException
DASException
- if DAS server returns error response codepublic static InputStream getInputStream(URL url) throws IOException
url
- the URL to connect to
IOException
DASException
- if DAS server returns error response codepublic static InputStream getInputStream(URL url, boolean acceptGzipEncoding, int timeout) throws IOException
url
- acceptGzipEncoding
-
IOException
DASException
- if DAS server returns error response codepublic static InputStream doPOST(URL url, String data) throws IOException
url
-
IOException
public static InputStream doPOST(URL url, String data, int timeout) throws IOException
url
-
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |