Package com.liferay.portal.kernel.util
Class HttpUtil
Object
com.liferay.portal.kernel.util.HttpUtil
- Author:
- Brian Wing Shun Chan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic javax.servlet.http.Cookie[]
static Http
getHttp()
static boolean
static boolean
isNonProxyHost
(String host) static boolean
isProxyHost
(String host) static byte[]
URLtoByteArray
(Http.Options options) static byte[]
URLtoByteArray
(String location) static byte[]
URLtoByteArray
(String location, boolean post) static InputStream
URLtoInputStream
(Http.Options options) static InputStream
URLtoInputStream
(String location) static InputStream
URLtoInputStream
(String location, boolean post) static String
URLtoString
(Http.Options options) static String
URLtoString
(String location) static String
URLtoString
(String location, boolean post) static String
URLtoString
(URL url) This method only uses the default Commons HttpClient implementation when the URL object represents a HTTP resource.
-
Constructor Details
-
HttpUtil
public HttpUtil()
-
-
Method Details
-
getCookies
public static javax.servlet.http.Cookie[] getCookies() -
getHttp
-
hasProxyConfig
public static boolean hasProxyConfig() -
isNonProxyHost
-
isProxyHost
-
URLtoByteArray
- Throws:
IOException
-
URLtoByteArray
- Throws:
IOException
-
URLtoByteArray
- Throws:
IOException
-
URLtoInputStream
- Throws:
IOException
-
URLtoInputStream
- Throws:
IOException
-
URLtoInputStream
- Throws:
IOException
-
URLtoString
- Throws:
IOException
-
URLtoString
- Throws:
IOException
-
URLtoString
- Throws:
IOException
-
URLtoString
This method only uses the default Commons HttpClient implementation when the URL object represents a HTTP resource. The URL object could also represent a file or some JNDI resource. In that case, the default Java implementation is used.- Parameters:
url
- the URL- Returns:
- A string representation of the resource referenced by the URL object
- Throws:
IOException
- if an IO Exception occurred
-