public void importData(CPSImporter im) { if (isDataAvailable()) { // TODO display a dialog that tells the user how this works, w/ the option to cancel String fileName = CPSGlobalSettings.getDocumentOutputDir() + System.getProperty("file.separator") + "ExportedCropsAndVars.csv"; // TODO verifty that the file actually exists getDataSource().importCropsAndVarieties(im.importCropsAndVarieties(fileName)); } }
public void exportData(CPSExporter exp) { if (isDataAvailable()) { // CPSExporter exp = new CSV(); String fileName = CPSGlobalSettings.getDocumentOutputDir() + System.getProperty("file.separator") + "ExportedCropsAndVars." + exp.getExportFileDefaultExtension(); exp.exportCropsAndVarieties(fileName, getDataSource().getCropAndVarietyList()); } else { System.err.println("ERROR(CropDB): No data exported, no data available."); } }