Examples of DocumentCacheItem


Examples of com.flaptor.hounder.crawler.modules.DocumentCacheItem

                ((Request)request).setHandled(true);
                return;
            }
            URL = URLDecoder.decode(URL, "UTF-8");
           
            DocumentCacheItem doc = multiCache.getItem(URL);
            if (doc != null) {
                response.setContentType(doc.getMimeType());
               
                if (doc.getMimeType().equals("text/html")) {
                    StringTemplate template = frameTemplate.getInstanceOf();
                    template.setAttribute("url", URL);
                    response.getOutputStream().write(template.toString().getBytes());
                }
                response.getOutputStream().write(doc.getContent());
            } else {
              StringTemplate template = notFoundTemplate.getInstanceOf();
                template.setAttribute("url", URL);
                response.getOutputStream().write(template.toString().getBytes());
//                response.sendError(HttpServletResponse.SC_NOT_FOUND);
View Full Code Here

Examples of fr.eolya.crawler.cache.DocumentCacheItem

                      sendUrl = getUrlWithoutIgnoredFields(sendUrl);
                      if (docCache==null) {
                        dh.sendDoc(new Integer(currentUrlItem.getSourceId()).toString(), sendUrl, new Integer(src.getAccountId()).toString(), urlLoader.getStream(), params, metas, src.getExtra(), this);                       
                      } else {
                        docCache.put(sendUrl, urlLoader.getStream(), 0, params, metas, src.getExtra())
                        DocumentCacheItem cacheItem = docCache.get(sendUrl);
                        dh.sendDoc(new Integer(currentUrlItem.getSourceId()).toString(), sendUrl, new Integer(src.getAccountId()).toString(), cacheItem.streamData, params, metas, src.getExtra(), this);                                               
                      }
                      //dh.sendDoc(new Integer(currentUrlItem.getSourceId()).toString(), sendUrl, new Integer(src.getAccountId()).toString(), urlLoader.getStream(), params, metas, src.getExtra(), this);
                      //if (docCache!=null) docCache.put(sendUrl, urlLoader.getStream(), 0, params, metas, src.getExtra());                     
                    }
View Full Code Here

Examples of fr.eolya.crawler.cache.DocumentCacheItem

      }

      InputStream inputSource = new ByteArrayInputStream(doc.get("content_base64").toString().getBytes());
      InputStream streamData = new Base64.InputStream(inputSource, Base64.DECODE);

      return new DocumentCacheItem( itemId, streamData, params, metas, extra);
    } catch (IOException e) {
      e.printStackTrace();
    }
    return null;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.