Package net.sf.jpluck.http

Examples of net.sf.jpluck.http.HttpClient.doGet()


    byte[] data = null;
    if (html.startsWith("http://")) {
      System.out.println("Downloading " + html);
      HttpClient httpClient = new HttpClient();
      HttpResponse response = httpClient.doGet(html);
      data = response.getContent();     
    } else {
      File file = new File(html);
      System.out.println("Reading " + file.getAbsolutePath());
      data = new byte[(int)file.length()];
View Full Code Here


        public void run() {
            try {
                HttpClient client = new HttpClient();
                String filename = convertToFilename(name);
                HttpResponse response = client.doGet(rootPath + "/" + filename);
                if (response.getStatusCode() == 200) {
                    byte[] data = response.getContent();
                    if (!JPluckX.getInstance().isWebStart()) {
                        FileOutputStream out = new FileOutputStream(new File(dir, filename));
                        out.write(data);
View Full Code Here

      HttpResponse response;
      if (Spider.isOffline()) {
        response = cached;
        logger.info(response.getStatusCode() + " " + response.getStatusMessage() + ": " + uri);
      } else {
        response = httpClient.doGet(uri, ifModifiedSince, spider.cookieStore);
        logger.info(response.getStatusCode() + " " + response.getStatusMessage() + ": " + uri);
        if (response.getStatusCode() == 304) {
          response = cached;
        }
      }
View Full Code Here

    public void run() {
        HttpClient httpClient = new HttpClient();
        try {
            httpClient.addHttpListener(this);
            HttpResponse response = httpClient.doGet(url);
            if (isVisible()) {
                this.response = response;
            }
        } catch (Exception e) {
            exception = e;
View Full Code Here

                        jxls += ("jxl" + i + "=" + URLEncoder.encode(file.getAbsolutePath(), "ISO-8859-1"));
                        if (i < (args.length - 1)) {
                            jxls += "&";
                        }
                    }
                    httpClient.doGet("http://127.0.0.1:9126/activate?" + jxls);
                } catch (Exception e2) {
                }
                System.exit(ExitCodes.OK);
            }
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.