Pencil-icon.png

Start Multi File Import via script or API

With "mfi" as instance of Multi File Import you can use the following source:

MultiFileImport.ImportSettings settings = mfi.getImportSettings(); // gets a copy of “ImportSettings”
List<File> currentImportDataFiles = settings.getImportDataFiles(); // current existing files in Multi File Import
List<File> newImportDataFiles = // add new Files
for (File file : newImportDataFiles) {
               if (currentImportDataFiles != null && currentImportDataFiles.contains(file) {
                              continue; // file exists
}
settings.addImportDataFile(file);
}
mfi.setImportSettings(settings);

Copyright by Kistler Chemnitz GmbH 2021
XWiki Enterprise 4.4 - Documentation