Package java.io

Examples of java.io.BufferedReader


   * @param url The url to download the informations from.
   * @param baseInfos The base infos for all available plugins.
   * @throws IOException
   */
  public SoftwareUpdater(URL url, PluginBaseInfo[] baseInfos) throws IOException {
    BufferedReader reader = new BufferedReader(new InputStreamReader(IOUtilities.getStream(url, 300000),"ISO-8859-1"));

    mSoftwareUpdateItems=readSoftwareUpdateItems(reader,true,false,baseInfos);

    reader.close();
  }
View Full Code Here


   * @param onlyUpdates If only updates and not new items should be accepted.
   * @param dragNdrop If the plugin was dropped.
   * @throws IOException
   */
  SoftwareUpdater(URL url, boolean onlyUpdates, boolean dragNdrop) throws IOException {
    BufferedReader reader = new BufferedReader(new InputStreamReader(IOUtilities.getStream(url, 300000),"ISO-8859-1"));

    mSoftwareUpdateItems=readSoftwareUpdateItems(reader,onlyUpdates,dragNdrop,null);

    reader.close();
  }
View Full Code Here

   */
  private String toString(InputStream inputStream) throws IOException {
    String string;
    StringBuilder outputBuilder = new StringBuilder();
    if (inputStream != null) {
      BufferedReader reader =
          new BufferedReader(new InputStreamReader(inputStream));
      while (null != (string = reader.readLine())) {
        outputBuilder.append(string).append('\n');
      }
    }
    return outputBuilder.toString().trim();
  }
View Full Code Here

     * @return
     */
    protected List executeUrl(String yahooUrl) throws TranslatorException {
        List rows = new ArrayList();
        InputStreamReader inSR  = null;
        BufferedReader buffReader = null;
       
        try {
            // create the URL object
            URL url = new URL(yahooUrl);
           
            // create the connection to the URL
            URLConnection conn = url.openConnection();

            // establish the connection to the URL                         
            conn.connect();
           
            // get the stream from the commection
            inSR = new InputStreamReader(conn.getInputStream());
           
            // place the stream into a buffered reader
            buffReader = new BufferedReader(inSR);         
           
            // now read each line from the Yahoo! Source and place
            // it into a StringBuffer object
            String line = null;
            while((line = buffReader.readLine()) != null){
                rows.add(parseLine(line));
            }
            // clean up our opened connections
            buffReader.close();
            inSR.close();
                       
        } catch(MalformedURLException mue){
            throw new TranslatorException(mue, mue.getMessage());
        } catch(IOException e) {
View Full Code Here

          URL url =
            new URL(
              frontUrl+"/section/"
                + section.getId()
                + ".html?static=true&nocache=true");
          BufferedReader reader =
            new BufferedReader(
              new InputStreamReader(url.openStream()));
          String content = "<!-- �ON static export -->";
          String line = "";
          while (line != null) {
            line = reader.readLine();
            if (line != null) {
              content += line;
            }
          }

          ZipEntry ze =
            new ZipEntry("section/" + section.getId() + ".html");
          zip.putNextEntry(ze);
          zip.write(content.getBytes());
          zip.closeEntry();
        } catch (Exception e) {
          System.out.println(
            "Static export error, section " + section.getId());
        }
      }

      // add publications
      Mapping.begin();
      Vector publications = Publication.listAll();
      Mapping.rollback();
      for (int i = 0; i < publications.size(); i++) {
        Publication publication = (Publication) publications.get(i);
        try {
          URL url =
            new URL(
              frontUrl+"/publication/"
                + publication.getId()
                + ".html?static=true&nocache=true");
          BufferedReader reader =
            new BufferedReader(
              new InputStreamReader(url.openStream()));
          String content = "<!-- �ON static export -->";
          String line = "";
          while (line != null) {
            line = reader.readLine();
            if (line != null) {
              content += line;
            }
          }
          ZipEntry ze =
            new ZipEntry(
              "publication/" + publication.getId() + ".html");
          zip.putNextEntry(ze);
          zip.write(content.getBytes());
          zip.closeEntry();
        } catch (Exception e) {
          System.out.println(
            "Static export error, publication "
              + publication.getId());
        }
      }

      // add index
      URL url =
        new URL(
          frontUrl+"?static=true&nocache=true");
      BufferedReader reader =
        new BufferedReader(new InputStreamReader(url.openStream()));
      String content = "<!-- �ON static export -->";
      String line = "";
      while (line != null) {
        line = reader.readLine();
        if (line != null) {
          content += line;
        }
      }
      ZipEntry ze = new ZipEntry("section/index.html");
View Full Code Here

        }
        runFile(fileName);
    }

    private void runFile(String fileName) throws IOException {
        LineNumberReader reader = new LineNumberReader(new BufferedReader(
                new InputStreamReader(IOUtils.openFileInputStream(fileName))));
        while (true) {
            String line = reader.readLine();
            if (line == null) {
                break;
View Full Code Here

   * any logging written to the appender after the invocation will not
   * be accessible through the reader.
   * @return A reader for the current buffer.
   */
  public Reader getReader() {
    return new BufferedReader(new InputStreamReader(new ByteArrayInputStream(getBuffer())));
  }
View Full Code Here

  /**
   * Writes the entire buffer to the given writer.
   * @param writer Writer to write to.
   */
  public void print(PrintStream stream) {
    BufferedReader reader = new BufferedReader(getReader());
    String line = null;
    try {
      while ((line=reader.readLine())!=null)
        stream.println(line);
    } catch (IOException e) {
      e.printStackTrace(stream);
    }
  }
View Full Code Here

    File wekaHome = WekaPackageManager.WEKA_HOME;
    File dialogSubDir = new File(wekaHome.toString() + File.separator
        + "systemDialogs" + File.separator + dialogName);

   
    BufferedReader br = new BufferedReader(new FileReader(dialogSubDir));
    String response = br.readLine();
   
    br.close();
    return response;
  }
View Full Code Here

  throws IOException,
  org.apache.regexp.RESyntaxException
  {
    this();

    BufferedReader reader =
      new BufferedReader(r);

    String line = "";
    int lineno=0;

    while (line != null) {
      line=reader.readLine();
      lineno++;

      if ((line != null) &&
          (! line.trim().equals("")) &&
          (! line.startsWith("#"))) {
View Full Code Here

TOP

Related Classes of java.io.BufferedReader

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.