private static void patchConfFile(File originalConf, File dest, String library)
      throws IOException {
    Scanner sc = new Scanner(originalConf);

    try {
      BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(dest)));

      try {
        boolean patched = false;

        while (sc.hasNextLine()) {
          String line = sc.nextLine();

          out.append(line);
          out.newLine();

          if (!patched && "[plexus.core]".equals(line)) {
            out.append("load ").append(library);
            out.newLine();

            patched = true;
          }
        }
      } finally {
        out.close();
      }
    } finally {
      sc.close();
    }
  }
  // saves changes to player data. MUST be called after you're done making
  // changes, otherwise a reload will lose them
  @Override
  public synchronized void savePlayerData(String playerName, PlayerData playerData) {
    // never save data for the "administrative" account. an empty string for
    // claim owner indicates administrative account
    if (playerName.length() == 0) return;

    BufferedWriter outStream = null;
    try {
      // open the player's file
      File playerDataFile =
          new File(playerDataFolderPath + File.separator + playerName.toLowerCase());
      playerDataFile.createNewFile();
      outStream = new BufferedWriter(new FileWriter(playerDataFile));

      // first line is last login timestamp
      if (playerData.lastLogin == null) playerData.lastLogin = new Date();
      DateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss");
      outStream.write(dateFormat.format(playerData.lastLogin));
      outStream.newLine();

      // second line is accrued claim blocks
      outStream.write(String.valueOf(playerData.accruedClaimBlocks));
      outStream.newLine();

      // third line is bonus claim blocks
      outStream.write(String.valueOf(playerData.bonusClaimBlocks));
      outStream.newLine();

      // fourth line is a double-semicolon-delimited list of claims
      /*if (playerData.claims.size() > 0) {
      	outStream.write(this.locationToString(playerData.claims.get(0).getLesserBoundaryCorner()));
      	for (int i = 1; i < playerData.claims.size(); i++) {
      		outStream.write(";;" + this.locationToString(playerData.claims.get(i).getLesserBoundaryCorner()));
      	}
      } */

      // write out wether the player's inventory needs to be cleared on join.
      outStream.newLine();
      outStream.write(String.valueOf(playerData.ClearInventoryOnJoin));
      outStream.newLine();
    }

    // if any problem, log it
    catch (Exception e) {
      GriefPrevention.AddLogEntry(
          "GriefPrevention: Unexpected exception saving data for player \""
              + playerName
              + "\": "
              + e.getMessage());
    }

    try {
      // close the file
      if (outStream != null) {
        outStream.close();
      }
    } catch (IOException exception) {
    }
  }
 public static void writeItemsControlFile() throws IOException {
   BufferedWriter bw = new BufferedWriter(new FileWriter("items.ctl"));
   bw.write("LOAD DATA");
   bw.newLine();
   bw.write("INFILE items.dat");
   bw.newLine();
   bw.write("INTO TABLE items");
   bw.newLine();
   bw.write("FIELDS TERMINATED BY ',' optionally enclosed by X'27'");
   bw.newLine();
   bw.write("(itemid,itemname)");
   bw.close();
 }
 public static void writeTransControlFile() throws IOException {
   BufferedWriter bw = new BufferedWriter(new FileWriter("trans.ctl"));
   bw.write("LOAD DATA");
   bw.newLine();
   bw.write("INFILE trans.dat");
   bw.newLine();
   bw.write("INTO TABLE trans");
   bw.newLine();
   bw.write("FIELDS TERMINATED BY ','");
   bw.newLine();
   bw.write("(transid,itemid)");
   bw.close();
 }
  public void printWeightUpdate() {

    String fileName = "WeightFile.txt";
    try {

      FileWriter fileWriter = new FileWriter(fileName);

      BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);

      System.out.println(
          "printWeightUpdate, put this i trainedWeights() and set isTrained to true");
      // weights for the hidden layer
      for (Neuron n : hiddenLayer) {
        ArrayList<Connection> connections = n.getAllInConnections();
        for (Connection con : connections) {
          String w = df.format(con.getWeight());
          System.out.println(
              "weightUpdate.put(weightKey(" + n.id + ", " + con.id + "), " + w + ");");

          bufferedWriter.write(ef.format(n.id));
          bufferedWriter.write(" ");
          bufferedWriter.write(ef.format(con.id));
          bufferedWriter.write(" ");
          bufferedWriter.write(w);
          bufferedWriter.newLine();
        }
      }
      // weights for the output layer
      for (Neuron n : outputLayer) {
        ArrayList<Connection> connections = n.getAllInConnections();
        for (Connection con : connections) {
          String w = df.format(con.getWeight());
          System.out.println(
              "weightUpdate.put(weightKey(" + n.id + ", " + con.id + "), " + w + ");");

          bufferedWriter.write(ef.format(n.id));
          bufferedWriter.write(" ");
          bufferedWriter.write(ef.format(con.id));
          bufferedWriter.write(" ");
          bufferedWriter.write(w);
          bufferedWriter.newLine();
        }
      }
      System.out.println();
      bufferedWriter.close();
    } catch (IOException ex) {

      System.out.println("Error writing to file " + fileName);
    }
  }
Exemple #6
0
  // Save data from LinkedHashMap to file
  public void save() {
    BufferedWriter bw = null;
    try {
      // Construct the BufferedWriter object
      bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(filename), "UTF-8"));
      bw.write("# " + pName + " Properties File");
      bw.newLine();

      // Save all the properties one at a time, only if there's data to write
      if (properties.size() > 0) {
        // Grab all the entries and create an iterator to run through them all
        Set<?> set = properties.entrySet();
        Iterator<?> i = set.iterator();

        // While there's data to iterate through..
        while (i.hasNext()) {
          // Map the entry and save the key and value as variables
          Map.Entry<?, ?> me = (Map.Entry<?, ?>) i.next();
          String key = (String) me.getKey();
          String val = me.getValue().toString();

          // If it starts with "#", it's a comment so write it as such
          if (key.charAt(0) == '#') {
            // Writing a comment to the file
            bw.write("# " + val);
            bw.newLine();
          } else {
            // Otherwise write the key and value pair as key=value
            bw.write(key + '=' + val);
            bw.newLine();
          }
        }
      }
    } catch (FileNotFoundException ex) {
      log.log(Level.SEVERE, '[' + pName + "]: Couldn't find file " + filename, ex);
      return;
    } catch (IOException ex) {
      log.log(Level.SEVERE, '[' + pName + "]: Unable to save " + filename, ex);
      return;
    } finally {
      // Close the BufferedWriter
      try {
        if (bw != null) bw.close();
      } catch (IOException ex) {
        log.log(Level.SEVERE, '[' + pName + "]: Unable to save " + filename, ex);
      }
    }
  }
  public void Have(String peer1, String peer2, int index) {
    String filename = "peer_" + peer1 + "/log_peer_" + peer1 + ".log";
    File file = new File(filename);
    if (!file.exists()) {
      CreateLog(peer1);
    }

    try {
      FileWriter fw = new FileWriter(filename, true); // the true will append the new data
      BufferedWriter bw = new BufferedWriter(fw);
      String str =
          getDate()
              + ": Peer "
              + peer1
              + " received the 'HAVE' message from Peer "
              + peer2
              + " for the piece "
              + index
              + ".";
      bw.write(str); // appends the string to the file
      bw.newLine();
      bw.close();
    } catch (IOException ioe) {
      ioe.printStackTrace();
    }
  }
Exemple #8
0
 /**
  * write categories to AIMLIF file
  *
  * @param cats array list of categories
  * @param filename AIMLIF filename
  */
 public void writeIFCategories(ArrayList<Category> cats, String filename) {
   // System.out.println("writeIFCategories "+filename);
   BufferedWriter bw = null;
   File existsPath = new File(aimlif_path);
   if (existsPath.exists())
     try {
       // Construct the bw object
       bw = new BufferedWriter(new FileWriter(aimlif_path + "/" + filename));
       for (Category category : cats) {
         bw.write(Category.categoryToIF(category));
         bw.newLine();
       }
     } catch (FileNotFoundException ex) {
       ex.printStackTrace();
     } catch (IOException ex) {
       ex.printStackTrace();
     } finally {
       // Close the bw
       try {
         if (bw != null) {
           bw.flush();
           bw.close();
         }
       } catch (IOException ex) {
         ex.printStackTrace();
       }
     }
 }
  /**
   * piirtää reitin tiedostoon ja reittikartta taulukkoon
   *
   * @param käydytsolmut
   * @throws IOException
   */
  public void piirräreitti(PriorityQueue<Solmu> käydytsolmut) throws IOException {

    String nimi = new String("uk");
    BufferedWriter reittikarttatiedosto = new BufferedWriter(new FileWriter("uk"));
    Solmu solmu = new Solmu(0, 0, null, 0);

    while (!käydytsolmut.isEmpty()) {
      solmu = käydytsolmut.poll();

      for (int n = 0; n < kartankoko; n++) {
        for (int i = 0; i < kartankoko; i++) {
          if (solmu.x == n && solmu.y == i) {
            // reittikartta[i][n] = '-';
            reittikartta[i][n] = (char) (solmu.summaamatkat(0, solmu.annavanhempi()) + 65);
            // reittikarttatiedosto.write("-");
            reittikarttatiedosto.write('-');
          } else {
            reittikarttatiedosto.write(reittikartta[i][n]);
          }
        }
        reittikarttatiedosto.newLine();
      }
    }
    reittikarttatiedosto.close();
    tulostakartta(reittikartta);
  }
  public void PieceDownload(String peer1, String peer2, int index, int pieces) {
    String filename = "peer_" + peer1 + "/log_peer_" + peer1 + ".log";
    File file = new File(filename);
    if (!file.exists()) {
      CreateLog(peer1);
    }

    try {
      FileWriter fw = new FileWriter(filename, true); // the true will append the new data
      BufferedWriter bw = new BufferedWriter(fw);
      String str =
          getDate()
              + ": Peer "
              + peer1
              + " has downloaded the piece "
              + index
              + " from Peer "
              + peer2
              + ". Now the number of pieces is "
              + pieces
              + ".";
      bw.write(str); // appends the string to the file
      bw.newLine();
      bw.close();
    } catch (IOException ioe) {
      ioe.printStackTrace();
    }
  }
  static void task1() throws FileNotFoundException, IOException, SQLException {
    // Read Input
    System.out.println("Task1 Started...");
    BufferedReader br = new BufferedReader(new FileReader(inputFile));
    br.readLine();
    String task1Input = br.readLine();
    br.close();
    double supportPercent =
        Double.parseDouble(task1Input.split(":")[1].split("=")[1].split("%")[0].trim());
    if (supportPercent >= 0) {
      System.out.println("Task1 Support Percent :" + supportPercent);
      // Prepare query
      String task1Sql =
          "select  temp.iname,(temp.counttrans/temp2.uniquetrans)*100 as percent"
              + " from (select i.itemname iname,count(t.transid) counttrans from trans t, items i"
              + " where i.itemid = t.itemid group by i.itemname having count(t.transid)>=(select count(distinct transid)*"
              + supportPercent / 100
              + " from trans)"
              + ") temp , (select count(distinct transid) uniquetrans from trans) temp2 order by percent";

      PreparedStatement selTask1 = con.prepareStatement(task1Sql);
      ResultSet rsTask1 = selTask1.executeQuery();

      BufferedWriter bw = new BufferedWriter(new FileWriter("system.out.1"));
      while (rsTask1.next()) {
        bw.write("{" + rsTask1.getString(1) + "}, s=" + rsTask1.getDouble(2) + "%");
        bw.newLine();
      }
      rsTask1.close();
      bw.close();
      System.out.println("Task1 Completed...\n");
    } else System.out.println("Support percent should be a positive number");
  }
  public void ServerConnectionIncoming(String peer1, String address, String port) {
    String filename = "peer_" + peer1 + "/log_peer_" + peer1 + ".log";
    File file = new File(filename);
    if (!file.exists()) {
      CreateLog(peer1);
    }

    try {
      FileWriter fw = new FileWriter(filename, true); // the true will append the new data
      BufferedWriter bw = new BufferedWriter(fw);
      String str =
          getDate()
              + "***Server for peer: "
              + peer1
              + " is ready to listen at :"
              + address
              + " at port : "
              + port;
      bw.write(str); // appends the string to the file
      bw.newLine();
      bw.close();
    } catch (IOException ioe) {
      ioe.printStackTrace();
    }
  }
  static void writeNewData(String datafile) {

    try {
      BufferedReader bufr = new BufferedReader(new FileReader(datafile));
      BufferedWriter bufw = new BufferedWriter(new FileWriter(datafile + ".nzf"));

      String line;
      String[] tokens;

      while ((line = bufr.readLine()) != null) {

        tokens = line.split(" ");
        bufw.write(tokens[0]);
        for (int i = 1; i < tokens.length; i++) {

          Integer index = Integer.valueOf(tokens[i].split(":")[0]);
          if (nnzFeas.contains(index)) {
            bufw.write(" " + tokens[i]);
          }
        }
        bufw.newLine();
      }
      bufw.close();
      bufr.close();

    } catch (Exception e) {
      e.printStackTrace();
      System.exit(0);
    }
  }
  public static void decry() {
    try {
      BufferedReader bf = new BufferedReader(new FileReader("ciphertext.txt"));
      BufferedWriter wr = new BufferedWriter(new FileWriter("plaintext.txt"));
      char rkey[] = new char[26];
      for (char i = 'a'; i <= 'z'; i++) {
        if (key.charAt(i - 'a') > 'z' || key.charAt(i - 'a') < 'a') continue;
        rkey[key.charAt(i - 'a') - 'a'] = i;
      }
      System.out.println(rkey);
      StringBuffer strb;
      String str;
      while (((str = bf.readLine())) != null) {
        strb = new StringBuffer(str);
        // System.out.println(strb);
        // String ans;
        for (int i = 0; i < strb.length(); i++) {
          if (strb.charAt(i) >= 'a' && strb.charAt(i) <= 'z') {
            strb.setCharAt(i, rkey[strb.charAt(i) - 'a']);
          }
        }
        System.out.println(strb.toString());
        wr.write(strb.toString());
        wr.newLine();
      }
      // keyf.close();
      wr.close();
      bf.close();

    } catch (IOException e) {

    }
  }
  // grants a group (players with a specific permission) bonus claim blocks as
  // long as they're still members of the group
  @Override
  synchronized void saveGroupBonusBlocks(String groupName, int currentValue) {
    // write changes to file to ensure they don't get lost
    BufferedWriter outStream = null;
    try {
      // open the group's file
      File groupDataFile = new File(playerDataFolderPath + File.separator + "$" + groupName);
      groupDataFile.createNewFile();
      outStream = new BufferedWriter(new FileWriter(groupDataFile));

      // first line is number of bonus blocks
      outStream.write(String.valueOf(currentValue));
      outStream.newLine();
    }

    // if any problem, log it
    catch (Exception e) {
      GriefPrevention.AddLogEntry(
          "Unexpected exception saving data for group \"" + groupName + "\": " + e.getMessage());
    }

    try {
      // close the file
      if (outStream != null) {
        outStream.close();
      }
    } catch (IOException exception) {
    }
  }
  public void write(OutputStream os) throws Exception {
    BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(os));

    String str = toString();
    bw.write(str, 0, str.length());
    bw.newLine();
    bw.close();
  }
Exemple #17
0
  public static void main(String[] args) throws IOException {
    Scanner in = new Scanner(new File("data.txt"));
    FileWriter promptStream = new FileWriter("prompts.txt");
    BufferedWriter promptOut = new BufferedWriter(promptStream);
    FileWriter choiceStream = new FileWriter("choice.txt");
    BufferedWriter choiceOut = new BufferedWriter(choiceStream);
    choiceOut.write(
        "$SQL_STRING = \"INSERT INTO \'$db_info[choice_table](`text`, `character`, `distance`, `size`) VALUES");
    choiceOut.newLine();
    promptOut.write("$SQL_STRING = \"INSERT INTO \'$db_info[prompt_table]\' (`text`) VALUES");
    promptOut.newLine();

    while (in.hasNextLine()) {
      String line = in.nextLine().trim();
      String[] check = line.split(" ");
      if (check[0].equals("prompt")) {
        promptOut.write("\t\t\t\t\t(\'" + line.substring(7) + "\'),");
        promptOut.newLine();
      } else if (check[0].equals("choice")) {

        if (check[1].matches("[0-6]#-?[0-6]#-?[0-6]")) {
          String[] characters = check[1].split("#");
          int start = check[0].length() + check[1].length() + 2;
          choiceOut.write(
              "\t\t\t\t\t(\'"
                  + line.substring(start)
                  + "\', \'"
                  + characters[0]
                  + "\', \'"
                  + characters[1]
                  + "\', \'"
                  + characters[2]
                  + "\'),");
          choiceOut.newLine();
        } else {
          System.out.println(check[1]);
          System.err.println("no point values found");
        }
      } else {
        System.err.println("line does not match anything. you fail");
      }
    }
    choiceOut.close();
    promptOut.close();
  }
Exemple #18
0
  private void saveRecord() {
    try {
      BufferedWriter bw =
          new BufferedWriter(
              new FileWriter(
                  "C:\\Users\\Szamani\\IdeaProjects\\snake\\src\\best.txt",
                  true)); // you may need to change this also :)

      bw.write(playerName);
      bw.newLine();
      bw.write(String.valueOf(score));
      bw.newLine();

      bw.close();
    } catch (IOException e) {
      e.printStackTrace();
    }
  }
 // 保存已经访问过的URL
 private static void SaveVisitedUrl(String filepath) throws Exception {
   BufferedWriter bw = new BufferedWriter(new FileWriter(filepath));
   Iterator<String> it = visitedUrl.iterator();
   while (it.hasNext()) {
     bw.write(it.next());
     bw.newLine();
   }
   bw.flush();
   bw.close();
 }
  public static void writeToFile(String text) {
    try {

      BufferedWriter bw =
          new BufferedWriter(new FileWriter(new File("BracketandWinner.txt"), true));
      bw.write(text);
      bw.newLine();
      bw.close();
    } catch (Exception e) {
    }
  }
Exemple #21
0
 public void run() {
   String line;
   try {
     while (null != (line = getLine())) {
       zWriter.write(line);
       zWriter.newLine();
       zWriter.flush();
     }
     zWriter.write("BYE");
     zWriter.newLine();
     zWriter.flush();
   } catch (IOException e) {
     // Presume socket has been closed.  Fail silently and stop thread
   }
   try {
     isOpen = false;
     zWriter.close();
   } catch (IOException ignore) {
   }
 }
Exemple #22
0
 /**
  * sends a raw message
  *
  * @param message is a string with the message
  */
 public void sendRaw(String message) {
   try {
     writer.write(message);
     writer.newLine();
     writer.flush();
   } catch (SocketException e) {
     System.out.println("[Server] Tried to send message to disconnected client.");
   } catch (IOException e) {
     e.printStackTrace();
   }
 }
Exemple #23
0
 private void writeUninstallerJarFileLog(UninstallData udata, JarOutputStream outJar)
     throws IOException {
   BufferedWriter logWriter;
   outJar.putNextEntry(new JarEntry("jarlocation.log"));
   logWriter = new BufferedWriter(new OutputStreamWriter(outJar));
   logWriter.write(udata.getUninstallerJarFilename());
   logWriter.newLine();
   logWriter.write(udata.getUninstallerPath());
   logWriter.flush();
   outJar.closeEntry();
 }
Exemple #24
0
  public static void main(String args[]) {
    Date now = new Date();
    DateFormat df = DateFormat.getDateInstance();
    String component = "Component : " + args[0];
    String date = "Date : " + df.format(now);
    ;
    String version = "Version : " + args[1];

    try {
      FileWriter fstream = new FileWriter("packInfo.txt");
      BufferedWriter out = new BufferedWriter(fstream);
      out.write(component);
      out.newLine();
      out.write(date);
      out.newLine();
      out.write(version);
      out.close();
    } catch (Exception e) {
      System.err.println("Error in opening a file");
    }
  }
 public static void writeText(String s) {
   FileWriter fWriter = null;
   BufferedWriter writer = null;
   try {
     fWriter = new FileWriter("info.txt", true);
     writer = new BufferedWriter(fWriter);
     writer.append(s);
     writer.newLine();
     writer.close();
   } catch (Exception e) {
   }
 }
 private void writeHeaderRow() throws DataAccessObjectInitializationException {
   CSVColumnVisitor visitor = new CSVColumnVisitor(fileOut);
   try {
     visitHeaderColumns(this.columnNames, visitor);
     fileOut.newLine();
     visitor.newRow();
   } catch (IOException e) {
     String errMsg = Messages.getString("CSVWriter.errorWriting");
     logger.error(errMsg, e); // $NON-NLS-1$
     throw new DataAccessObjectInitializationException(errMsg, e);
   }
 }
  private void applyLabel(String inPointsFile, String outPointsFile, List<String> symbols) {
    System.out.println("Applying labels for points file: " + inPointsFile);
    FileReader input;
    BufferedWriter bufWriter = null;
    try {
      FileOutputStream fos = new FileOutputStream(outPointsFile);
      bufWriter = new BufferedWriter(new OutputStreamWriter(fos));

      File inFile = new File(inPointsFile);
      if (!inFile.exists()) {
        System.out.println("ERROR: In file doens't exist");
        return;
      }
      input = new FileReader(inPointsFile);
      BufferedReader bufRead = new BufferedReader(input);
      String inputLine;
      int index = 0;
      while ((inputLine = bufRead.readLine()) != null && index < symbols.size()) {
        Point p = Utils.readPoint(inputLine);
        String symbol = symbols.get(index);
        int clazz = 0;
        if (this.invertedFixedClases.containsKey(symbol)) {
          clazz = this.invertedFixedClases.get(symbol);
        } else {
          // get the corresponding symbol
          // get the class for this one
          String sector = invertedSectors.get(symbol);
          if (sector != null) {
            clazz = sectorToClazz.get(sector);
          } else {
            //                    System.out.println("No sector: " + symbol);
          }
        }
        p.setClazz(clazz);
        String s = p.serialize();
        bufWriter.write(s);
        bufWriter.newLine();
        index++;
      }
      System.out.println("Read lines: " + index);
    } catch (Exception e) {
      throw new RuntimeException("Failed to read/write file", e);
    } finally {
      if (bufWriter != null) {
        try {
          bufWriter.close();
        } catch (IOException ignore) {
        }
      }
    }
  }
Exemple #28
0
  /*
   * Finds the total distance for the path traveled given by the string inputString.
   */
  private static void findDistance(String inputString) {
    int distance = 0;
    boolean flag;

    while (inputString.indexOf("-") != -1) {
      flag = false;
      first = inputString.charAt(0);
      inputString = inputString.substring(inputString.indexOf("-") + 1);
      if (inputString.indexOf("-") != -1) {
        second = inputString.charAt(0);
      } else {
        second = inputString.charAt(0);
      }

      edgeList = nodeMap.get(first).getEdges();
      for (i = 0; i < edgeList.size(); i++) {
        if (edgeList.get(i).getEdgeDestination() == second) {
          distance += edgeList.get(i).getEdgeLength();
          flag = true;
        }
      }
      if (flag == false) {
        try {
          bw.write("NO SUCH ROUTE");
          bw.newLine();
        } catch (IOException e) {
          System.out.println(e);
        }
        return;
      }
    }
    try {
      bw.write(Integer.toString(distance));
      bw.newLine();
    } catch (IOException e) {
      System.out.println(e);
    }
  }
  /**
   * This method performed followint tasks 1. Extract tweet text from tweetline and created_at time
   * 2. Clean the tweet text by removing unicodes and replacing non-ascii characters 3. Persist
   * cleaned tweet text and time into file
   *
   * @param cleanTweetFileWriter
   * @param tweet
   * @throws Exception
   */
  private void persistCleantedTweet(BufferedWriter cleanTweetFileWriter, Tweet tweet)
      throws Exception {

    if (cleanTweetFileWriter != null && tweet != null) {

      // Format the tweet text and created date
      String formattedTweetText =
          tweet.getTweetText().getTweetText() + " (" + tweet.getCreatedDate() + ")";

      // Persist formatted text into file and append new line.
      cleanTweetFileWriter.write(formattedTweetText);
      cleanTweetFileWriter.newLine();
    }
  }
 /*
  * (non-Javadoc)
  * @see com.salesforce.dataloader.dao.csv.Writer#writeRow(java.util.Map)
  */
 public boolean writeRow(Map<String, Object> columnValues) throws DataAccessObjectException {
   CSVColumnVisitor visitor = new CSVColumnVisitor(fileOut);
   try {
     visitColumns(columnNames, columnValues, visitor);
     fileOut.newLine();
     visitor.newRow();
     currentRowNumber++;
     return true; // success unless there's an exception
   } catch (IOException e) {
     logger.error(Messages.getString("CSVWriter.errorWriting"), e); // $NON-NLS-1$
     throw new DataAccessObjectException(
         Messages.getString("CSVWriter.errorWriting"), e); // $NON-NLS-1$
   }
 }