Commit 6e239a86 authored by Peter Schumacher's avatar Peter Schumacher
Browse files

fixed wrong file getter

parent 9560c3a3
Pipeline #267598061 passed with stage
in 2 minutes and 55 seconds
package com.encircle360.oss.straightmail.service.template;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
......@@ -21,6 +24,15 @@ public abstract class AbstractTemplateLoader implements TemplateLoader {
log.error(e.getMessage());
}
}
Path filePath = Paths.get("/resources/templates/" + path);
if (Files.exists(filePath)) {
try {
return Files.readString(filePath);
} catch (Exception e) {
log.error(e.getMessage());
}
}
return null;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment