if (inventory != null) { String fileID = defaultSaveCSVPath + inventory.getOrg() + "-" + (inventory.getItem().replaceAll("/", "-")) + "-" + formatTimeStamp(new Date(), false) + ".csv"; System.out.println("Save to file: " + fileID); fileChooser.setSelectedFile(new File(fileID)); } int retval = fileChooser.showSaveDialog(this); if (retval == fileChooser.APPROVE_OPTION) { File saveFile = fileChooser.getSelectedFile(); try { FileWriter fw = new FileWriter(saveFile); fw.write(editPane.getText()); fw.flush(); fw.close(); } catch (IOException ioe) { throw new RuntimeException(ioe); } } }
    protected void saveXML() {	File pathDirs = new File(defaultSaveCSVPath);	try {	    if(!pathDirs.exists()){		pathDirs.mkdirs();	    }	}	catch(Exception ex) {	    logger.error("Error creating default directory " + defaultSaveCSVPath, ex);	}	if(inventory != null) {	    String fileID = defaultSaveCSVPath + inventory.getOrg() + "-" + (inventory.getItem().replaceAll("/","-")) + "-" + formatTimeStamp(new Date(), false) + ".csv";	    System.out.println("Save to file: " + fileID);	    fileChooser.setSelectedFile(new File(fileID));	}	int retval = fileChooser.showSaveDialog(this);	if(retval == fileChooser.APPROVE_OPTION) {	    File saveFile = fileChooser.getSelectedFile();	    try{		FileWriter fw = new FileWriter(saveFile);		fw.write(editPane.getText());		fw.flush();		fw.close();	    }	    catch(IOException ioe) {		throw new RuntimeException(ioe);	    }	}		    }