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 HttpgetHttp()static booleanstatic booleanisNonProxyHost(String host) static booleanisProxyHost(String host) static byte[]URLtoByteArray(Http.Options options) static byte[]URLtoByteArray(String location) static byte[]URLtoByteArray(String location, boolean post) static InputStreamURLtoInputStream(Http.Options options) static InputStreamURLtoInputStream(String location) static InputStreamURLtoInputStream(String location, boolean post) static StringURLtoString(Http.Options options) static StringURLtoString(String location) static StringURLtoString(String location, boolean post) static StringURLtoString(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
-