diff options
author | Anton Tananaev <anton@traccar.org> | 2024-02-24 17:23:39 -0800 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2024-02-24 17:23:39 -0800 |
commit | b37c5aa05bdd903af998435e073638f42ae9e8d1 (patch) | |
tree | fbde716bb11f5ff5ce636b45850696d0ec7f5f91 | |
parent | 77b3f9f4b05dfc44809b578eaae55645f496b65c (diff) | |
download | trackermap-server-b37c5aa05bdd903af998435e073638f42ae9e8d1.tar.gz trackermap-server-b37c5aa05bdd903af998435e073638f42ae9e8d1.tar.bz2 trackermap-server-b37c5aa05bdd903af998435e073638f42ae9e8d1.zip |
Remove unknown template
-rw-r--r-- | src/main/java/org/traccar/notification/TextTemplateFormatter.java | 15 | ||||
-rw-r--r-- | templates/full/unknown.vm | 7 | ||||
-rw-r--r-- | templates/short/unknown.vm | 2 |
3 files changed, 2 insertions, 22 deletions
diff --git a/src/main/java/org/traccar/notification/TextTemplateFormatter.java b/src/main/java/org/traccar/notification/TextTemplateFormatter.java index ab90d76d4..cc6935982 100644 --- a/src/main/java/org/traccar/notification/TextTemplateFormatter.java +++ b/src/main/java/org/traccar/notification/TextTemplateFormatter.java @@ -75,19 +75,8 @@ public class TextTemplateFormatter { } public Template getTemplate(String name, String path) { - - String templateFilePath; - Template template; - - try { - templateFilePath = Paths.get(path, name + ".vm").toString(); - template = velocityEngine.getTemplate(templateFilePath, StandardCharsets.UTF_8.name()); - } catch (ResourceNotFoundException error) { - LOGGER.warn("Notification template error", error); - templateFilePath = Paths.get(path, "unknown.vm").toString(); - template = velocityEngine.getTemplate(templateFilePath, StandardCharsets.UTF_8.name()); - } - return template; + String templateFilePath = Paths.get(path, name + ".vm").toString(); + return velocityEngine.getTemplate(templateFilePath, StandardCharsets.UTF_8.name()); } public NotificationMessage formatMessage(VelocityContext velocityContext, String name, String templatePath) { diff --git a/templates/full/unknown.vm b/templates/full/unknown.vm deleted file mode 100644 index 566ce0d42..000000000 --- a/templates/full/unknown.vm +++ /dev/null @@ -1,7 +0,0 @@ -#set($subject = "Unknown type") -<!DOCTYPE html> -<html> -<body> -Unknown type -</body> -</html> diff --git a/templates/short/unknown.vm b/templates/short/unknown.vm deleted file mode 100644 index 2f9d5e3af..000000000 --- a/templates/short/unknown.vm +++ /dev/null @@ -1,2 +0,0 @@ -#set($subject = "Unknown type") -Unknown type |