File pathDirs = new File(defaultCSVPath); try { if(!pathDirs.exists()){ pathDirs.mkdirs(); } } catch(Exception ex) { logger.error("Error creating default directory " + defaultCSVPath, ex); }
    public void actionPerformed(ActionEvent e) {	if(e.getActionCommand().equals(InventoryMenuEvent.MENU_Exit)) {	    System.exit(0);	}	else if(e.getActionCommand().equals(InventoryMenuEvent.MENU_Connect)) {	    connectToServlet();	}	else if(e.getActionCommand().equals(InventoryMenuEvent.MENU_SaveXML)) {	    if(inventory != null) {		String fileID = defaultCSVPath + 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);		}	    }			}	else if(e.getActionCommand().equals("Parse")) {	    logger.info("Parsing");	    inventory = parser.parseString(dataSource.getCurrentInventoryData());	    multiChart.setData(inventory);	}	else if(e.getActionCommand().equals("Data")) {	    editPane.setText(dataSource.getCurrentInventoryData());	}    }