Search in sources :

Example 1 with HTTPResource

use of lucee.commons.io.res.type.http.HTTPResource in project Lucee by lucee.

the class Feed method doStartTag.

@Override
public int doStartTag() throws PageException {
    if (source instanceof HTTPResource) {
        HTTPResource httpSource = (HTTPResource) source;
        if (!StringUtil.isEmpty(proxyServer, true)) {
            ProxyData data = new ProxyDataImpl(proxyServer, proxyPort, proxyUser, proxyPassword);
            httpSource.setProxyData(data);
        }
        if (!StringUtil.isEmpty(userAgent))
            httpSource.setUserAgent(userAgent);
        if (timeout > -1)
            httpSource.setTimeout(timeout * 1000);
    }
    try {
        if (ACTION_CREATE == action)
            doActionCreate();
        else if (ACTION_READ == action)
            doActionRead();
    } catch (Exception e) {
        throw Caster.toPageException(e);
    }
    return SKIP_BODY;
}
Also used : ProxyData(lucee.runtime.net.proxy.ProxyData) HTTPResource(lucee.commons.io.res.type.http.HTTPResource) ProxyDataImpl(lucee.runtime.net.proxy.ProxyDataImpl) PageException(lucee.runtime.exp.PageException) IOException(java.io.IOException) ExpressionException(lucee.runtime.exp.ExpressionException) ApplicationException(lucee.runtime.exp.ApplicationException) SAXException(org.xml.sax.SAXException)

Aggregations

IOException (java.io.IOException)1 HTTPResource (lucee.commons.io.res.type.http.HTTPResource)1 ApplicationException (lucee.runtime.exp.ApplicationException)1 ExpressionException (lucee.runtime.exp.ExpressionException)1 PageException (lucee.runtime.exp.PageException)1 ProxyData (lucee.runtime.net.proxy.ProxyData)1 ProxyDataImpl (lucee.runtime.net.proxy.ProxyDataImpl)1 SAXException (org.xml.sax.SAXException)1