/** * Load files from each of the given paths, using the underlying DocumentFileReader. * <p> * If a DocumentFileReader has not been set yet, then one will be constructed before any files are read. * * @param paths * @return */ public List<DocumentFile> loadFiles(String... paths) { batchWriter.initialize(); initializeDocumentFileReader(); List<DocumentFile> documentFiles = documentFileReader.readDocumentFiles(paths); if (documentFiles != null && !documentFiles.isEmpty()) { writeBatchOfDocuments(documentFiles, 0); if (waitForCompletion) { batchWriter.waitForCompletion(); } } return documentFiles; }