Skip to content
Snippets Groups Projects
Commit 07d9e605 authored by Martin Vogel's avatar Martin Vogel
Browse files

chore(cmd-runner): return ImportRecord instead of generic type

parent 9819de48
No related branches found
No related tags found
No related merge requests found
package dev.fitko.fitconnect.client.cmd.batch;
import dev.fitko.fitconnect.api.exceptions.BatchImportException;
import java.io.IOException;
import java.util.List;
public interface BatchImporter {
/**
* Read data from path to list of type T
* Read data from path to list of ImportRecords.
*
* @param path to the file that should be imported
*
* @return List of mapped records
*
* @throws IOException if the path could not be read or the import failed
*/
<T> List<T> readRecords(String path) throws BatchImportException;
List<ImportRecord> readRecords(String path);
}
......@@ -18,7 +18,7 @@ public class CsvImporter implements BatchImporter {
try {
final Reader reader = new BufferedReader(new FileReader(path));
return readToImportRecords(reader);
} catch (final FileNotFoundException e) {
} catch (final FileNotFoundException | IllegalStateException e) {
throw new BatchImportException(e.getMessage(), e);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment