Code example for HttpContext

Methods: getAttribute

0
        returnValues.put("content", result.toString());
        return returnValues;
    } 
 
    private static String extractUriFromHttpContext(HttpContext localContext) {
        String newHost = ((HttpHost) localContext.getAttribute(ExecutionContext.HTTP_TARGET_HOST)).toURI();
        String path = ((HttpRequest) localContext.getAttribute(ExecutionContext.HTTP_REQUEST)).getRequestLine()
                .getUri();
        String newUri = newHost + path;
        return newUri;
    } 
} 
 
class U2 { 
 
    static CharSequence readInputStreamIntoString(InputStream is, String charsetName, long started, Job job)
            throws IOException, DownloadCancelledException, DownloadTimedOutException { 
        // LATER throw an Exception when the buffer get's to big 
 
        // Matcher m = WebPageDownloadDirector.PATTERN_CHARSET.matcher(result); 
        // if (m.find()) {