Package java.io

Examples of java.io.FileWriter


  Report report = new Report();
  report.setDatabaseConnection(conn);

  OUT_FILE.deleteOnExit();
  PrintWriter out = new PrintWriter(new FileWriter(OUT_FILE));
  report.setLayoutEngine(new CharSepLE(out, '\t'));

  report.runReport();
    }
    catch (Exception e) {
View Full Code Here


                    prep.setString(6, v[2].toString());
                    prep.execute();
                }
            }

            writer = new PrintWriter(new FileWriter(out));
            ResultSet rs = stat.executeQuery(
                    "CALL '<table><tr><th>Test Case</th><th>Unit</th>' "
                    +"|| SELECT GROUP_CONCAT('<th>' || DB || '</th>' ORDER BY DBID SEPARATOR '') FROM "
                    +"(SELECT DISTINCT DBID, DB FROM RESULTS)"
                    +"|| '</tr>' || CHAR(10) "
View Full Code Here

  public void writeToFile(String filePath, String tabName)
  {
    String LINE_SEPARATOR = "\n";

    FileWriter out = null;
    try {
      File outputFile = new File(filePath);

      if (outputFile.exists()) {
        outputFile.delete();
      }

      out = new FileWriter(outputFile);

      ResultSet rs = stmt.executeQuery();
      ResultSetMetaData md = rs.getMetaData();
      int cc = md.getColumnCount();

      String columnNames = "";
      String columnValues = "";

      for (int i = 1; i <= cc; i++) {
        columnNames = columnNames + "\t" + md.getColumnName(i);
      }

      columnNames = columnNames+LINE_SEPARATOR;
      while (rs.next()) {
        for (int i = 1; i <= cc; i++) {
          columnValues = columnValues + "\t" + rs.getObject(i);
        }

        columnValues = columnValues + LINE_SEPARATOR;
      }
      out.write(columnNames + columnValues);
      out.close();
    } catch(Exception e) {
      System.out.println("[Exception][CVDal.writeToFile] Exception Thrown: "+e);
      e.printStackTrace();
    }
  }
View Full Code Here

    private static Writer getOverallSummaryStream(String outputDir)
      throws IOException {
  boolean exists = false;
  File summaryFile = new File(outputDir, OVERALL_SUMMARY_FILE); //$NON-NLS-1$
  exists = summaryFile.exists();
    FileWriter fstream = new FileWriter(summaryFile,true);
          BufferedWriter out = new BufferedWriter(fstream);

  if (!exists) {

          try {
View Full Code Here

    private static Writer getOverallSummaryErrorsStream(String outputDir)
    throws IOException {
  boolean exists = false;
  File summaryFile = new File(outputDir, OVERALL_SUMMARY_ERROR_FILE); //$NON-NLS-1$
  exists = summaryFile.exists();
  FileWriter fstream = new FileWriter(summaryFile,true);
        BufferedWriter out = new BufferedWriter(fstream);

        if (!exists) {

            try {
View Full Code Here

    }

  private void writeResultSet(File expected, BufferedReader resultReader)
      throws IOException {
    if (WRITE_ACTUAL) {
      BufferedWriter bw = new BufferedWriter(new FileWriter(expected));
      String s = null;
      while ((s = resultReader.readLine()) != null) {
        bw.write(s);
        bw.write("\n"); //$NON-NLS-1$
      }
View Full Code Here

     * Saves the pattern as a text file
     * @param filename the filename to save under
     */
    public void savePattern(File file) throws IOException
    {
        BufferedWriter out = new BufferedWriter(new FileWriter(file));
        if ((getProperties().size() > 0) || (getTitle() != null)) {
            out.write("#\n");
            if (getTitle() != null) {
                out.write("# ");
                out.write("Title: ");
View Full Code Here

    static Writer out;

    static private void outRules(String name) throws IOException {
        count = 0;
        // if (true) throw new RuntimeException();
        out = new FileWriter("src/com/hp/hpl/jena/iri/impl/"+name+".jflex");
        copy("src/com/hp/hpl/jena/iri/impl/iri.jflex");
        out.write("%class Lexer");
        out.write(name.substring(0, 1).toUpperCase());
        out.write(name.substring(1));
        out.write("\n%%\n");
View Full Code Here

        String jflexFile = "src/com/hp/hpl/jena/iri/impl/"+name+".jflex";
       
        if (name.equals("scheme")|| name.equals("port")) {
           
        } else {
            out = new FileWriter("tmp.jflex");
            copy(jflexFile);
            jflexFile = "tmp.jflex";
            copy("src/com/hp/hpl/jena/iri/impl/xchar.jflex");
            out.close();
        }
View Full Code Here

    }

    public PublishArtifact writePom(final File pomFile) {
        try {
            pomFile.getParentFile().mkdirs();
            FileWriter writer = new FileWriter(pomFile);
            try {
                getPom().writeTo(writer);
            } finally {
                writer.close();
            }
        } catch (IOException e) {
            throw new UncheckedIOException(e);
        }
View Full Code Here

TOP

Related Classes of java.io.FileWriter

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.