mirror of https://github.com/beemdevelopment/Aegis
Continue importing entries even if one can't be parsed
parent
fc0e1150f6
commit
592c6683c3
@ -0,0 +1,14 @@
|
|||||||
|
package com.beemdevelopment.aegis.importers;
|
||||||
|
|
||||||
|
public class DatabaseImporterEntryException extends Exception {
|
||||||
|
private String _text;
|
||||||
|
|
||||||
|
public DatabaseImporterEntryException(Throwable cause, String text) {
|
||||||
|
super(cause);
|
||||||
|
_text = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getText() {
|
||||||
|
return _text;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package com.beemdevelopment.aegis.importers;
|
||||||
|
|
||||||
|
import com.beemdevelopment.aegis.db.DatabaseEntry;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class DatabaseImporterResult {
|
||||||
|
private List<DatabaseEntry> _entries = new ArrayList<>();
|
||||||
|
private List<DatabaseImporterEntryException> _errors = new ArrayList<>();
|
||||||
|
|
||||||
|
public void addEntry(DatabaseEntry entry) {
|
||||||
|
_entries.add(entry);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addError(DatabaseImporterEntryException error) {
|
||||||
|
_errors.add(error);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<DatabaseEntry> getEntries() {
|
||||||
|
return _entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<DatabaseImporterEntryException> getErrors() {
|
||||||
|
return _errors;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue