diff --git a/src/main/java/org/mybatis/scripting/freemarker/support/TemplateFilePathProvider.java b/src/main/java/org/mybatis/scripting/freemarker/support/TemplateFilePathProvider.java index 3773789..5140bc7 100644 --- a/src/main/java/org/mybatis/scripting/freemarker/support/TemplateFilePathProvider.java +++ b/src/main/java/org/mybatis/scripting/freemarker/support/TemplateFilePathProvider.java @@ -1,5 +1,5 @@ /** - * Copyright 2015-2019 the original author or authors. + * Copyright 2015-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -208,7 +208,8 @@ private static boolean exists(String path) { String basePath = languageDriverConfig.getTemplateFile().getBaseDir(); String actualPath = basePath.isEmpty() ? path : basePath + (basePath.endsWith("/") ? "" : "/") + path; try { - return Resources.getResourceAsFile(actualPath).exists(); + Resources.getResourceURL(actualPath); + return true; } catch (IOException e) { return false; }