Skip to content

Commit 6175bca

Browse files
committed
Stop calling File.exists method on TemplateFilePathProvider
Because it always return false on Spring Boot Fat Jar. Fixes gh-55
1 parent 210f4db commit 6175bca

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/org/mybatis/scripting/thymeleaf/support/TemplateFilePathProvider.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2018-2019 the original author or authors.
2+
* Copyright 2018-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -207,7 +207,8 @@ private static boolean exists(String path) {
207207
String basePath = languageDriverConfig.getTemplateFile().getBaseDir();
208208
String actualPath = basePath.isEmpty() ? path : basePath + (basePath.endsWith("/") ? "" : "/") + path;
209209
try {
210-
return Resources.getResourceAsFile(actualPath).exists();
210+
Resources.getResourceURL(actualPath);
211+
return true;
211212
} catch (IOException e) {
212213
return false;
213214
}

0 commit comments

Comments
 (0)