Skip to content

Commit

Permalink
All CloseableTemplateModel except for string content types.
Browse files Browse the repository at this point in the history
  • Loading branch information
brett-smith committed Mar 22, 2024
1 parent d7374aa commit 086de1a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/sshtools/tinytemplate/Templates.java
Original file line number Diff line number Diff line change
Expand Up @@ -363,16 +363,16 @@ public void close() {

public static class TemplateModel {

public static TemplateModel ofPath(Path path) {
public static CloseableTemplateModel ofPath(Path path) {
try {
return new TemplateModel(Files.newBufferedReader(path));
return new CloseableTemplateModel(Files.newBufferedReader(path));
}
catch(IOException ioe) {
throw new UncheckedIOException(ioe);
}
}

public static TemplateModel ofFile(File file) {
public static CloseableTemplateModel ofFile(File file) {
return ofPath(file.toPath());
}

Expand Down

0 comments on commit 086de1a

Please sign in to comment.