public XgapExcelImport(File extractDir, Database db, boolean skipWhenDestExists) throws Exception { File excelFile = null; File dataDir = null; // at this point we are sure that: // 1) extractDir has 1 or 2 file objects // 2) one of these ends with '.xls' // 3) if two: one of these is called 'data' for (File f : extractDir.listFiles()) { if (f.getName().endsWith(".xls")) { excelFile = f; } if (f.getName().equals("data")) { // FIXME: test on all OS. Does this fix another Windows File // bug? does it break on other OS'es? dataDir = new File(f.getAbsolutePath()); } } db.beginTx(); try { ExcelImport.importAll(excelFile, db, new SimpleTuple(), false); if (dataDir != null) { List<String> investigationNames = getInvestigationNameFromExcel(excelFile); XgapCommonImport.importMatrices(investigationNames, db, false, dataDir, skipWhenDestExists); } db.commitTx(); } catch (Exception e) { db.rollbackTx(); throw (e); } }