aboutsummaryrefslogtreecommitdiff
path: root/velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader
diff options
context:
space:
mode:
authorClaude Brisson <cbrisson@apache.org>2019-03-06 21:19:34 +0000
committerClaude Brisson <cbrisson@apache.org>2019-03-06 21:19:34 +0000
commitf31d3d3f1e419db9f7400b0f1e3d7844f5493693 (patch)
treed5717ccd03fa2c51363f608005d8e3206554105d /velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader
parentedbabf4c93e8b1cd5f94f157fdde403a7b5c8d31 (diff)
downloadapache-velocity-engine-f31d3d3f1e419db9f7400b0f1e3d7844f5493693.tar.gz
[engine] configuration key names refactoring proposal
git-svn-id: https://svn.apache.org/repos/asf/velocity/engine/branches/VELOCITY-909@1854947 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader')
-rw-r--r--velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/FileResourceLoader.java3
-rw-r--r--velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java3
-rw-r--r--velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/ResourceLoader.java10
3 files changed, 9 insertions, 7 deletions
diff --git a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/FileResourceLoader.java b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/FileResourceLoader.java
index 363ba563..f8c5a811 100644
--- a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/FileResourceLoader.java
+++ b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/FileResourceLoader.java
@@ -21,6 +21,7 @@ package org.apache.velocity.runtime.resource.loader;
import org.apache.velocity.exception.ResourceNotFoundException;
import org.apache.velocity.exception.VelocityException;
+import org.apache.velocity.runtime.RuntimeConstants;
import org.apache.velocity.runtime.resource.Resource;
import org.apache.velocity.util.ExtProperties;
@@ -72,7 +73,7 @@ public class FileResourceLoader extends ResourceLoader
{
log.trace("FileResourceLoader: initialization starting.");
- paths.addAll( configuration.getVector("path") );
+ paths.addAll( configuration.getVector(RuntimeConstants.RESOURCE_LOADER_PATHS) );
// trim spaces from all paths
for (ListIterator<String> it = paths.listIterator(); it.hasNext(); )
diff --git a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java
index be4ce328..8ed76835 100644
--- a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java
+++ b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java
@@ -21,6 +21,7 @@ package org.apache.velocity.runtime.resource.loader;
import org.apache.velocity.exception.ResourceNotFoundException;
import org.apache.velocity.exception.VelocityException;
+import org.apache.velocity.runtime.RuntimeConstants;
import org.apache.velocity.runtime.resource.Resource;
import org.apache.velocity.util.ExtProperties;
@@ -91,7 +92,7 @@ public class JarResourceLoader extends ResourceLoader
{
log.trace("JarResourceLoader: initialization starting.");
- List paths = configuration.getList("path");
+ List paths = configuration.getList(RuntimeConstants.RESOURCE_LOADER_PATHS);
if (paths != null)
{
diff --git a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/ResourceLoader.java b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/ResourceLoader.java
index 354514bb..e2fc7b43 100644
--- a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/ResourceLoader.java
+++ b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/ResourceLoader.java
@@ -92,23 +92,23 @@ public abstract class ResourceLoader
try
{
- isCachingOn = configuration.getBoolean("cache", false);
+ isCachingOn = configuration.getBoolean(RuntimeConstants.RESOURCE_LOADER_CACHE, false);
}
catch (Exception e)
{
isCachingOn = false;
- String msg = "Exception parsing cache setting: " + configuration.getString("cache");
+ String msg = "Exception parsing cache setting: " + configuration.getString(RuntimeConstants.RESOURCE_LOADER_CACHE);
log.error(msg, e);
throw new VelocityException(msg, e);
}
try
{
- modificationCheckInterval = configuration.getLong("modificationCheckInterval", 0);
+ modificationCheckInterval = configuration.getLong(RuntimeConstants.RESOURCE_LOADER_CHECK_INTERVAL, 0);
}
catch (Exception e)
{
modificationCheckInterval = 0;
- String msg = "Exception parsing modificationCheckInterval setting: " + configuration.getString("modificationCheckInterval");
+ String msg = "Exception parsing modificationCheckInterval setting: " + RuntimeConstants.RESOURCE_LOADER_CHECK_INTERVAL;
log.error(msg, e);
throw new VelocityException(msg, e);
}
@@ -119,7 +119,7 @@ public abstract class ResourceLoader
className = ResourceCacheImpl.class.getName();
try
{
- className = configuration.getString("class", className);
+ className = configuration.getString(RuntimeConstants.RESOURCE_LOADER_CLASS, className);
}
catch (Exception e)
{