Package org.vietspider.common.io

Examples of org.vietspider.common.io.DataReader


   
    webClient.setUserAgent("Mozilla/5.0 (compatible; Yahoo! VN Slurp; http://help.yahoo.com/help/us/ysearch/slurp)");
//    webClient.registryProxy("216.194.70.3", 8118, null, null);
   
    final DataWriter writer = new DataWriter();
    final DataReader reader = new DataReader();
    File file  = new File("F:\\Temp2\\webclient\\proxies.txt") ;
    String textValue  = new String(reader.load(file), "utf-8");
    String [] proxies = textValue.split("\n");
    File newFile  = new File("F:\\Temp2\\webclient\\good.proxies.txt") ;
  
    final File folder = new File("F:\\Temp2\\webclient\\proxy\\");
    deleteFolder(folder);
View Full Code Here


    char [] chars = CharsDecoder.decode(charset, data, 0, data.length);
    return createDocument(chars, decoder);
 
 
  public static XMLDocument createDocument(InputStream input, String charset, XMLDataDecoder decoder) throws Exception {
    DataReader reader = new DataReader();
    return createDocument(reader.loadInputStream(input).toByteArray(), charset, decoder)
  }
View Full Code Here

    DataReader reader = new DataReader();
    return createDocument(reader.loadInputStream(input).toByteArray(), charset, decoder)
  }
 
  public static XMLDocument createDocument(File file, String charset, XMLDataDecoder decoder) throws Exception {
    DataReader reader = new DataReader();
    return createDocument(reader.load(file), charset, decoder);
  }
View Full Code Here

 
  private void loadBadProxies() {
    File file  = UtilFile.getFile("system/proxy/", "bad.proxies.txt");
    String [] elements = null;
    try {
      String text = new String(new DataReader().load(file), "utf-8");
      elements = text.split("\n");
    } catch (Exception e) {
    }
    if(elements == null || elements.length < 1) return;
    for(int i = 0; i < elements.length; i++) {
View Full Code Here

    char [] chars = CharsDecoder.decode(charset, data, 0, data.length);
    return createDocument(chars);
 

  public  HTMLDocument createDocument(InputStream input, String charset) throws Exception {
    DataReader reader = new DataReader();
    return createDocument(reader.loadInputStream(input).toByteArray(), charset)
  }
View Full Code Here

    DataReader reader = new DataReader();
    return createDocument(reader.loadInputStream(input).toByteArray(), charset)
  }

  public HTMLDocument createDocument(File file, String charset) throws Exception {
    DataReader reader = new DataReader();
    return createDocument(reader.load(file), charset);
  }
View Full Code Here

    this.charset = charset_;
    if(charset != null && charset.trim().length() < 1) charset = null;
  }
 
  public HTMLDocument loadDocument(File file) throws Exception {
    DataReader reader = new DataReader();
    byte [] bytes = reader.load(file);
    return charset != null ? createDocument(bytes, charset) : detectDocument(bytes);
 
View Full Code Here

    return createDocument(chars);
 

  @Deprecated()
  public static HTMLDocument createDocument(InputStream input, String charset) throws Exception {
    DataReader reader = new DataReader();
    return createDocument(reader.loadInputStream(input).toByteArray(), charset)
  }
View Full Code Here

    return createDocument(reader.loadInputStream(input).toByteArray(), charset)
  }

  @Deprecated()
  public static HTMLDocument createDocument(File file, String charset) throws Exception {
    DataReader reader = new DataReader();
    return createDocument(reader.load(file), charset);
 
View Full Code Here

    url = new URL(path);
    file = new File(url.toURI());

    System.out.println(file.getPath());
    System.out.println("*********************************************************");
    DataReader buffer = new DataReader();
    String text = new String(buffer.load(file), "utf-8");
    CharsToken tokens = new CharsToken();
    TokenParser tokenParser = new TokenParser();
    tokenParser.createBeans(tokens, text.toCharArray());
    while(tokens.hasNext()){
      NodeImpl node = tokens.pop();
View Full Code Here

TOP

Related Classes of org.vietspider.common.io.DataReader

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.