scantor commented on code in PR #51:
URL: https://github.com/apache/velocity-engine/pull/51#discussion_r1747277500
##########
spring-velocity-support/src/main/java/org/apache/velocity/spring/VelocityEngineFactory.java:
##########
@@ -259,41 +281,61 @@ protected VelocityEngine newVelocityEngine() throws
IOException, VelocityExcepti
*/
protected void initVelocityResourceLoader(VelocityEngine velocityEngine,
String resourceLoaderPath) {
if (isPreferFileSystemAccess()) {
+
+ // Only used with enhanced processing.
+ final List<String> filePaths = new ArrayList<>();
+ final List<String> nonFilePaths = new ArrayList<>();
+
+ String[] paths =
StringUtils.commaDelimitedListToStringArray(resourceLoaderPath);
+
// Try to load via the file system, fall back to
SpringResourceLoader
// (for hot detection of template changes, if possible).
- try {
- StringBuilder resolvedPath = new StringBuilder();
- String[] paths =
StringUtils.commaDelimitedListToStringArray(resourceLoaderPath);
- for (int i = 0; i < paths.length; i++) {
- String path = paths[i];
+ for (int i = 0; i < paths.length; i++) {
+ String path = paths[i];
+
+ // Don't check classpath: locations, they're not file-based.
+ // Some containers will expand jars and trigger false
positives.
+ // If enhanced behavior isn't on, this will
fall into the usual code it did before.
+ if (isSupportClasspathEnhancements() &&
path.startsWith(ResourceLoader.CLASSPATH_URL_PREFIX)) {
Review Comment:
I will prepare a simplied patch (with no tabs, sigh) later today then.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]