Example usage for com.liferay.portal.kernel.util HttpUtil URLtoInputStream

List of usage examples for com.liferay.portal.kernel.util HttpUtil URLtoInputStream

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util HttpUtil URLtoInputStream.

Prototype

public static InputStream URLtoInputStream(String location) throws IOException 

Source Link

Usage

From source file:com.liferay.rss.web.internal.util.RSSWebCacheItem.java

License:Open Source License

private InputStream _readURL() throws IOException {
    URL url = new URL(_url);

    if ("file".equals(url.getProtocol())) {
        return url.openStream();
    }/*  www .ja v a  2  s  .  co m*/

    Http.Options options = new Http.Options();

    options.setLocation(_url);
    options.setTimeout(PropsValues.RSS_CONNECTION_TIMEOUT);

    return HttpUtil.URLtoInputStream(options);
}