svn commit: r1834637 - in /velocity/tools/trunk: src/site/ velocity-tools-examples/src/ velocity-tools-examples/velocity-tools-examples-showcase/src/test/resources/ velocity-tools-examples/velocity-to

2018-06-28 Thread michaelo
Author: michaelo
Date: Thu Jun 28 19:50:25 2018
New Revision: 1834637

URL: http://svn.apache.org/viewvc?rev=1834637=rev
Log:
Delete empty directories

Removed:
velocity/tools/trunk/src/site/
velocity/tools/trunk/velocity-tools-examples/src/

velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/test/resources/

velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-simple/src/main/resources/

velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-simple/src/test/
velocity/tools/trunk/velocity-tools-generic/src/site/
velocity/tools/trunk/velocity-tools-view-jsp/src/site/
velocity/tools/trunk/velocity-tools-view-jsp/src/test/resources/

velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/i18n/
velocity/tools/trunk/velocity-tools-view/src/site/



svn commit: r1834638 - /velocity/tools/trunk/velocity-tools-generic/src/main/resources/org/apache/velocity/tools/generic/times.properties

2018-06-28 Thread michaelo
Author: michaelo
Date: Thu Jun 28 19:55:02 2018
New Revision: 1834638

URL: http://svn.apache.org/viewvc?rev=1834638=rev
Log:
Use wellknown abbreviations allowed by BIPM

Modified:

velocity/tools/trunk/velocity-tools-generic/src/main/resources/org/apache/velocity/tools/generic/times.properties

Modified: 
velocity/tools/trunk/velocity-tools-generic/src/main/resources/org/apache/velocity/tools/generic/times.properties
URL: 
http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/resources/org/apache/velocity/tools/generic/times.properties?rev=1834638=1834637=1834638=diff
==
--- 
velocity/tools/trunk/velocity-tools-generic/src/main/resources/org/apache/velocity/tools/generic/times.properties
 (original)
+++ 
velocity/tools/trunk/velocity-tools-generic/src/main/resources/org/apache/velocity/tools/generic/times.properties
 Thu Jun 28 19:55:02 2018
@@ -58,13 +58,13 @@ second.abbr=s
 seconds.abbr=s
 minute.abbr=min
 minutes.abbr=min
-hour.abbr=hr
-hours.abbr=hrs
-day.abbr=day
-days.abbr=days
-week.abbr=wk
-weeks.abbr=wks
-month.abbr=mo
-months.abbr=mos
-year.abbr=yr
-years.abbr=yrs
+hour.abbr=h
+hours.abbr=h
+day.abbr=d
+days.abbr=d
+week.abbr=w
+weeks.abbr=w
+month.abbr=m
+months.abbr=m
+year.abbr=y
+years.abbr=y




svn commit: r1834601 - in /velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view: ServletUtils.java VelocityView.java

2018-06-28 Thread cbrisson
Author: cbrisson
Date: Thu Jun 28 12:14:41 2018
New Revision: 1834601

URL: http://svn.apache.org/viewvc?rev=1834601=rev
Log:
[tools/view] Config code simplification: relies on servlet context for 
WEB-INF/*, on class loader for everything else

Modified:

velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ServletUtils.java

velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityView.java

Modified: 
velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ServletUtils.java
URL: 
http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ServletUtils.java?rev=1834601=1834600=1834601=diff
==
--- 
velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ServletUtils.java
 (original)
+++ 
velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ServletUtils.java
 Thu Jun 28 12:14:41 2018
@@ -297,22 +297,18 @@ public class ServletUtils
 return null;
 }
 
-public static InputStream getInputStream(final String path, ServletContext 
application)
-{
-return getInputStream(path, application, true, true);
-}
-
-public static InputStream getInputStream(final String path, final 
ServletContext application, boolean searchClasspath, boolean searchWebapp)
+public static InputStream getInputStream(final String path, final 
ServletContext application)
 {
 InputStream inputStream = null;
-// first search classpath if asked so
-if (searchClasspath)
+boolean webappResource = path != null && (path.startsWith("WEB-INF") 
|| path.startsWith("/WEB-INF"));
+if (!webappResource)
 {
+// search classpath except for WEB-INF/*
 inputStream = ClassUtils.getResourceAsStream(path, 
ServletUtils.class);
 }
-if (inputStream == null && searchWebapp)
+else
 {
-// then webapp
+// then webapp only for WEB-INF/*
 if (System.getSecurityManager() != null)
 {
 inputStream = AccessController.doPrivileged(

Modified: 
velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityView.java
URL: 
http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityView.java?rev=1834601=1834600=1834601=diff
==
--- 
velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityView.java
 (original)
+++ 
velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityView.java
 Thu Jun 28 12:14:41 2018
@@ -337,15 +337,14 @@ public class VelocityView extends ViewTo
 protected void configure(final JeeConfig config, final VelocityEngine 
velocity)
 {
 // first get the default properties from the classpath, and bail if we 
don't find them
-Properties defaultProperties = getProperties(DEFAULT_PROPERTIES_PATH, 
true, true, false);
+Properties defaultProperties = getProperties(DEFAULT_PROPERTIES_PATH, 
true);
 velocity.setProperties(defaultProperties);
 
 // check for application-wide user props in the context init params
 String appPropsPath = servletContext.getInitParameter(PROPERTIES_KEY);
 if (appPropsPath != null)
 {
-boolean isInWebInf = appPropsPath.startsWith("/WEB-INF") || 
appPropsPath.startsWith("WEB-INF");
-Properties appProperties = getProperties(appPropsPath, true, 
!isInWebInf, isInWebInf);
+Properties appProperties = getProperties(appPropsPath, true);
 getLog().debug("Configuring Velocity with properties at: {}", 
appPropsPath);
 velocity.setProperties(appProperties);
 }
@@ -355,7 +354,7 @@ public class VelocityView extends ViewTo
 if (servletPropsPath != null && (appPropsPath == null || 
!appPropsPath.equals(servletPropsPath)))
 {
 boolean isInWebInf = servletPropsPath.startsWith("/WEB-INF") || 
servletPropsPath.startsWith("WEB-INF");
-Properties servletProperties = getProperties(servletPropsPath, 
true, !isInWebInf, isInWebInf);
+Properties servletProperties = getProperties(servletPropsPath, 
true);
 getLog().debug("Configuring Velocity with properties at: {}", 
servletPropsPath);
 velocity.setProperties(servletProperties);
 }
@@ -364,7 +363,7 @@ public class VelocityView extends ViewTo
 // conventional location, and be silent if they're missing
 if (appPropsPath == null && servletPropsPath == null)
 {
-Properties appProperties = getProperties(USER_PROPERTIES_PATH,