title: Exporting JTable to csv FileNotFoundException
body: <p>I've got an issue where I'm using the code found here
  <a href="https://sites.google.com/site/teachmemrxymon/java/export-records-from-jtable-to-ms-excel" rel="nofollow">https://sites.google.com/site/teachmemrxymon/java/export-records-from-jtable-to-ms-excel</a></p>
  
  <p>However when running the code it throws up the exception:
  java.io.FileNotFoundException: /home/david\test.csv (Permission denied)</p>
  
  <p>Straight away I can see that there's an issue as it looks to use Windows formatting of file paths rather than Linux.</p>
  
  <p>Is there a way I can change this?</p>
  
  <p>The code I have is as follows:</p>
  
  <pre><code>private void saveBike1LapActionPerformed(java.awt.event.ActionEvent evt) {                                             
      JFileChooser bike1FileChooser = new JFileChooser();
      int option = bike1FileChooser.showSaveDialog(TrackerWindow.this);
      if(option == JFileChooser.APPROVE_OPTION){
          String filename = bike1FileChooser.getSelectedFile().getName(); 
          String path = bike1FileChooser.getSelectedFile().getParentFile().getPath();
          int len = filename.length();
          String ext = "";
          String file;
          if(len &gt; 4){
      ext = filename.substring(len-4, len);
          }
          if(ext.equals(".csv")){
          file = path + "\\" + filename; 
          }
          else{
          file = path + "\\" + filename + ".csv"; 
          }
          exportBikeLapTimes(bike1LapTimes, new File(file));
      }
  }
  </code></pre>
  
  <p>Any help would be greatly appreciated.</p>