diff --git a/gretl/src/integrationTest/jobs/Csv2Excel/20230124_sap_Gebaeude.xlsx b/gretl/src/integrationTest/jobs/Csv2Excel/20230124_sap_Gebaeude.xlsx index 8644c642..5006ebc4 100644 Binary files a/gretl/src/integrationTest/jobs/Csv2Excel/20230124_sap_Gebaeude.xlsx and b/gretl/src/integrationTest/jobs/Csv2Excel/20230124_sap_Gebaeude.xlsx differ diff --git a/gretl/src/integrationTest/jobs/XslTransformerFile/MeldungAnGeometer_G-0098981_20230214_104054_Koordinaten.xtf b/gretl/src/integrationTest/jobs/XslTransformerFile/MeldungAnGeometer_G-0098981_20230214_104054_Koordinaten.xtf index ea592a68..cc976c3a 100644 --- a/gretl/src/integrationTest/jobs/XslTransformerFile/MeldungAnGeometer_G-0098981_20230214_104054_Koordinaten.xtf +++ b/gretl/src/integrationTest/jobs/XslTransformerFile/MeldungAnGeometer_G-0098981_20230214_104054_Koordinaten.xtf @@ -19,7 +19,7 @@ 1505 CH940632814686 SO0200002580 - 2023-10-23 + 2023-10-26 Anbau 2009 Reine Wohngebäude (Wohnnutzung ausschliesslich) diff --git a/gretl/src/main/java/ch/so/agi/gretl/tasks/Ili2pgImport.java b/gretl/src/main/java/ch/so/agi/gretl/tasks/Ili2pgImport.java index 12b62967..246a858d 100644 --- a/gretl/src/main/java/ch/so/agi/gretl/tasks/Ili2pgImport.java +++ b/gretl/src/main/java/ch/so/agi/gretl/tasks/Ili2pgImport.java @@ -30,21 +30,50 @@ public void importData() { if (dataFile == null) { return; } - FileCollection dataFilesCollection=null; - if(dataFile instanceof FileCollection) { - dataFilesCollection=(FileCollection)dataFile; - }else { - dataFilesCollection=getProject().files(dataFile); - } - if (dataFilesCollection == null || dataFilesCollection.isEmpty()) { - return; - } + + // Liste mit saemtlicheen Dateipfaeden oder ilidata-Ids. List files = new ArrayList(); - for (java.io.File fileObj : dataFilesCollection) { - String fileName = fileObj.getPath(); - files.add(fileName); + + FileCollection dataFilesCollection = null; + if(dataFile instanceof FileCollection) { + dataFilesCollection = (FileCollection) dataFile; + + if (dataFilesCollection == null || dataFilesCollection.isEmpty()) { + return; + } + + for (File fileObj : dataFilesCollection) { + String fileName = fileObj.getPath(); + files.add(fileName); + } + } else if(dataFile instanceof File) { + File file = (File) dataFile; + files.add(file.getAbsolutePath()); + } else if(dataFile instanceof String) { + String fileName = (String) dataFile; + if (fileName.startsWith("ilidata")) { + files.add(fileName); + } else { + File file = this.getProject().file(fileName); + files.add(file.getAbsolutePath()); + } + } else { + List dataFileList = (ArrayList) dataFile; + for (String fileName : dataFileList) { + + if (fileName.startsWith("ilidata")) { + files.add(fileName); + } else { + File file = this.getProject().file(fileName); + files.add(file.getAbsolutePath()); + } + } + if (files.size() == 0) { + return; + } } - java.util.List datasetNames=null; + + List datasetNames = null; if (dataset != null) { if(dataset instanceof String) { datasetNames=new ArrayList();