Skip to content

Commit 399ff42

Browse files
authored
Merge pull request #80 from kazuki43zoo/gh-79
Stop calling File.exists method on TemplateFilePathProvider
2 parents 42c3d19 + 312573c commit 399ff42

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2015-2019 the original author or authors.
2+
* Copyright 2015-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.
@@ -208,7 +208,8 @@ private static boolean exists(String path) {
208208
String basePath = languageDriverConfig.getTemplateFile().getBaseDir();
209209
String actualPath = basePath.isEmpty() ? path : basePath + (basePath.endsWith("/") ? "" : "/") + path;
210210
try {
211-
return Resources.getResourceAsFile(actualPath).exists();
211+
Resources.getResourceURL(actualPath);
212+
return true;
212213
} catch (IOException e) {
213214
return false;
214215
}

0 commit comments

Comments
 (0)