rem: } else { app.debug("WARNING: timeouts can only be set due to Java version < 1.5"); 
context:     this.getUrl = function(url, opt) {        if (typeof url == "string") {            if (!(url = helma.Http.evalUrl(url)))                throw new Error("'" + url + "' is not a valid URL.");        } else if (!(url instanceof java.net.URL)) {            throw new Error("'" + url + "' is not a valid URL.");        }                var conn = proxy ? url.openConnection(proxy) : url.openConnection();        conn.setFollowRedirects(followRedirects);        conn.setAllowUserInteraction(false);        conn.setRequestMethod(method);        conn.setRequestProperty("User-Agent", userAgent);        if (opt) {            if (opt instanceof Date)                conn.setIfModifiedSince(opt.getTime());            else if ((typeof opt == "string") && (opt.length > 0))                conn.setRequestProperty("If-None-Match", opt);        }        if (credentials != null) {            conn.setRequestProperty("Authorization", "Basic " + credentials);        }        if (parseFloat(java.lang.System.getProperty("java.specification.version"), 10) >= 1.5) {            conn.setConnectTimeout(timeout.connect);            conn.setReadTimeout(timeout.socket);        } else {            app.debug("WARNING: timeouts can only be set due to Java version < 1.5");        }        for (var i in headers)            conn.setRequestProperty(i, headers[i]);        if (content) {            conn.setRequestProperty("Content-Length", content.length);            conn.setDoOutput(true);            var out = new java.io.OutputStreamWriter(conn.getOutputStream());            out.write(content);            out.flush();            out.close();        }        var result = {            url: conn.getURL(),            location: conn.getHeaderField("location"),            code: conn.getResponseCode(),            message: conn.getResponseMessage(),            length: conn.getContentLength(),            type: conn.getContentType(),            encoding: conn.getContentEncoding(),            lastModified: null,            eTag: null,            content: null        }        var lastmod = conn.getLastModified();        if (lastmod)            result.lastModified = new Date(lastmod);        result.eTag = conn.getHeaderField("ETag");            if (result.length != 0 && result.code == 200) {            var body = new java.io.ByteArrayOutputStream();            var input = new java.io.BufferedInputStream(conn.getInputStream());            var buf = java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024);            var str;            while ((str = input.read(buf)) > -1) {                body.write(buf, 0, str);            }            input.close();            if (binaryMode) {                result.content = body.toByteArray();            } else {                result.content = result.encoding ?                            body.toString(result.encoding) :                            body.toString();            }            result.length = result.content.length;        }        conn.disconnect();        return result;    }
meta: 2504	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/2504/b11fce933f369e10a8a1cca8ac4ca10d7a687a61/Http.js/buggy/helma/Http.js