Skip to content

Commit

Permalink
replaces \n characters with a newline when parsing the status content
Browse files Browse the repository at this point in the history
  • Loading branch information
tdiepenb committed Jan 11, 2025
1 parent a134e28 commit 754f5c8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main/java/de/uoc/dh/idh/autodone/services/ImportService.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,17 @@ public StatusEntity importStatus(String line, int number) throws Exception {
} else {
throw new Exception("Please enter a correct date and time in the first two columns");
}

String content = columns[2].replace("\\n", "\n");

if (columns[2].isEmpty()) {

if (content.isEmpty()) {
status.exceptions.add(new ParseException("No content found (3rd column)", number));
} else if (columns[2].length() > 500) {
} else if (content.length() > 500) {
status.exceptions.add(new ParseException("Content trimmed (3rd column)", number));
status.status = columns[2].substring(0, 495) + "[...]";
status.status = content.substring(0, 495) + "[...]";
} else {
status.status = columns[2];
status.status = content;
}

if (columns.length > 3) {
Expand Down

0 comments on commit 754f5c8

Please sign in to comment.