Package org.webharvest.runtime.processors

Examples of org.webharvest.runtime.processors.HttpProcessor


                Constructor inputSourceConstructor = inputSourceClass.getConstructor(
                        new Class[]{InputStream.class, String.class, String.class});
                Method documentBuilderParse = documentBuilderClass.getMethod("parse", InputSource.class);

                for (int i = 0; i < defs.length; i++) {
                    HttpProcessor processor = (HttpProcessor) ProcessorResolver.createProcessor(
                            defs[i], scraper.getConfiguration(), scraper);
                    String documentURI = ((HttpDef) processor.getElementDef()).getUrl();
                    HttpInfo httpInfo = (HttpInfo) context.get("http");
                    Variable content = processor.run(scraper, context);

                    try {
                        // A document URI and a charset should be provided.
                        Object inputSource = inputSourceConstructor.newInstance(
                                new Object[]{new ByteArrayInputStream(content.toBinary()), documentURI, httpInfo.charset});
View Full Code Here

TOP

Related Classes of org.webharvest.runtime.processors.HttpProcessor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.