Add VelocityProperties.preferFilesystemAccess
Update VelocityProperties to include a preferFilesystemAccess attribute. Fixes gh-1652
This commit is contained in:
parent
62eb01f0b8
commit
5d32ec7463
|
|
@ -81,6 +81,7 @@ public class VelocityAutoConfiguration {
|
||||||
|
|
||||||
protected void applyProperties(VelocityEngineFactory factory) {
|
protected void applyProperties(VelocityEngineFactory factory) {
|
||||||
factory.setResourceLoaderPath(this.properties.getResourceLoaderPath());
|
factory.setResourceLoaderPath(this.properties.getResourceLoaderPath());
|
||||||
|
factory.setPreferFileSystemAccess(this.properties.isPreferFileSystemAccess());
|
||||||
Properties velocityProperties = new Properties();
|
Properties velocityProperties = new Properties();
|
||||||
velocityProperties.putAll(this.properties.getProperties());
|
velocityProperties.putAll(this.properties.getProperties());
|
||||||
factory.setVelocityProperties(velocityProperties);
|
factory.setVelocityProperties(velocityProperties);
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,8 @@ public class VelocityProperties extends AbstractTemplateViewResolverProperties {
|
||||||
|
|
||||||
private String toolboxConfigLocation;
|
private String toolboxConfigLocation;
|
||||||
|
|
||||||
|
private boolean preferFileSystemAccess = true;
|
||||||
|
|
||||||
public VelocityProperties() {
|
public VelocityProperties() {
|
||||||
super(DEFAULT_PREFIX, DEFAULT_SUFFIX);
|
super(DEFAULT_PREFIX, DEFAULT_SUFFIX);
|
||||||
}
|
}
|
||||||
|
|
@ -92,6 +94,14 @@ public class VelocityProperties extends AbstractTemplateViewResolverProperties {
|
||||||
this.toolboxConfigLocation = toolboxConfigLocation;
|
this.toolboxConfigLocation = toolboxConfigLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isPreferFileSystemAccess() {
|
||||||
|
return this.preferFileSystemAccess;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPreferFileSystemAccess(boolean preferFileSystemAccess) {
|
||||||
|
this.preferFileSystemAccess = preferFileSystemAccess;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void applyToViewResolver(Object viewResolver) {
|
public void applyToViewResolver(Object viewResolver) {
|
||||||
super.applyToViewResolver(viewResolver);
|
super.applyToViewResolver(viewResolver);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue