public final class HTTPUtils extends Object
Modifier and Type | Method and Description |
---|---|
static URLConnection |
getURLConnection(URL url,
Properties properties)
Gets a URL Connection.
|
static String |
processConnectionResponse(URLConnection connection)
Process connection response.
|
static String |
processRequest(URL url,
Properties requestProperties)
Processes an HTTP Request.
|
static String |
readHttpHeader(InputStream inputStream)
Read a line with a CRLF from an input stream.
|
static void |
writeURLConnection(URLConnection connection)
Write URL Connection.
|
public static String readHttpHeader(InputStream inputStream) throws IOException
inputStream
- the input stream.IOException
- If EOF, missing CRLF or the header is too longpublic static String processRequest(URL url, Properties requestProperties) throws IOException
url
- the target for the request.requestProperties
- request propertiesIOException
- if unable to process the requestpublic static void writeURLConnection(URLConnection connection) throws IOException
connection
- the URL connectionIOException
- if unable to writepublic static String processConnectionResponse(URLConnection connection) throws IOException
connection
- the URL connectionIOException
- if unable to process connection responsepublic static URLConnection getURLConnection(URL url, Properties properties) throws IOException
url
- the target of the connection.properties
- http headers to set on the connectionIOException
- if unable to get connectionCopyright © 2016 Push Technology Ltd. All Rights Reserved.