Examples of writeAll()


Examples of Writers.FileWriter.writeAll()

        }
        if(filePath.endsWith("pdf")){
            writer = new PDFWriter(data, result, outputFile, pageSetup, coverPage, author, projectDesc);
        }
        if (writer!=null) {
            writer.writeAll();
        }else
            throw new Exception("Unsupported File Format");
    }
   
    /**
 
View Full Code Here

Examples of au.com.bytecode.opencsv.CSVWriter.writeAll()

        statement = connection.createStatement();
        ResultSet resultSet = statement.executeQuery(sql);

        Writer writer = new StringWriter();
        CSVWriter csvwriter = new CSVWriter(writer);
        csvwriter.writeAll(resultSet, true);

        return writer;
    }

View Full Code Here

Examples of au.com.bytecode.opencsv.CSVWriter.writeAll()

   * @param values A List of String[], with each String[] representing a line of the file.
   */
  public static void writeMultipleColumnCSV(Writer writer, List<String[]> values) {
    try {
      CSVWriter csvWriter = new CSVWriter(writer, CSVWriter.DEFAULT_SEPARATOR, CSVWriter.NO_QUOTE_CHARACTER);
      csvWriter.writeAll(values);
      csvWriter.close();
    } catch (IOException exception) {
      throw new UnexpectedException("Error writing the values", exception);
    }
  }
View Full Code Here

Examples of au.com.bytecode.opencsv.CSVWriter.writeAll()

          CSVWriter.NO_QUOTE_CHARACTER);

      for (Exportable item : list)
        data.add(item.toCsv());

      writer.writeAll(data);
      writer.close();
    } catch (Exception e) {
      logger.error("writerFile", e);
    }
View Full Code Here

Examples of au.com.bytecode.opencsv.CSVWriter.writeAll()

        StringWriter swriter = new StringWriter();
        CSVWriter writer = new CSVWriter(swriter,   DEFAULT_SEPARATOR_CHAR.charAt(0),
                                                    DEFAULT_QUOTE_CHAR.charAt(0),
                                                    DEFAULT_ESCAPE_CHAR.charAt(0));

        writer.writeAll(lines);
        writer.close();

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        BufferedWriter bWriter = new BufferedWriter(new OutputStreamWriter(baos));
        bWriter.write(swriter.toString());
View Full Code Here

Examples of au.com.bytecode.opencsv.CSVWriter.writeAll()

                    }
                    String filePath = createFileName(outputDir, fileName, fileExtension, recordCount);
                    Mediator.getLogger(RecordCsvWriter.class.getName()).log(Level.FINE, "About to write {0} record(s) to {1}",
                            new Object[]{recordCount, filePath});
                    csvWriter = new CSVWriter(new FileWriter(new File(filePath)));
                    csvWriter.writeAll(format.format(tempLinkedRecordList));
                    Mediator.getLogger(RecordCsvWriter.class.getName()).log(Level.FINE, "Finished writing {0} record(s) to {1}",
                            new Object[]{recordCount, filePath});
                    tempLinkedRecordList.clear();
                }
                i++;
View Full Code Here

Examples of au.com.bytecode.opencsv.CSVWriter.writeAll()

                    }
                    String filePath = createFileName(recordCount);
                    Mediator.getLogger(CpadDataExtract.class.getName()).log(Level.FINE, "About to write {0} record(s) to {1}",
                            new Object[]{recordCount, filePath});
                    csvWriter = new CSVWriter(new FileWriter(new File(filePath)), '\t');
                    csvWriter.writeAll(recordList);
                    Mediator.getLogger(CpadDataExtract.class.getName()).log(Level.FINE, "Finished writing {0} record(s) to {1}",
                            new Object[]{recordCount, filePath});
                    recordList.clear();
                }
            }
View Full Code Here

Examples of au.com.bytecode.opencsv.CSVWriter.writeAll()

    setExportFilename(promptUserforSave());

    try
    {
      CSVWriter writer = new CSVWriter(new FileWriter(getExportFilename()), ',');
      writer.writeAll(temp, true);
      writer.close();
    } catch (Exception e)
    {
      result = false;
      setErrorMessage(e.getMessage());
View Full Code Here

Examples of au.com.bytecode.opencsv.CSVWriter.writeAll()

                    stmt.setFetchSize(50);

                    rs = stmt.executeQuery();

                    CSVWriter writer = new CSVWriter(new FileWriter(exportFilename), ',');
                    writer.writeAll(rs, true);

                    rs.close();

                    stmt.close();
View Full Code Here

Examples of au.com.bytecode.opencsv.CSVWriter.writeAll()

      rs = getResultSet();
     
      StringWriter sw = new StringWriter();
     
      CSVWriter writer = new CSVWriter(sw);
      writer.writeAll(rs, false);
      writer.close();
     
      System.out.println(sw);
    }
    catch (Exception ex)
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.