You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2011/06/13 20:58:10 UTC

svn commit: r1135223 - /camel/trunk/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java

Author: davsclaus
Date: Mon Jun 13 18:58:10 2011
New Revision: 1135223

URL: http://svn.apache.org/viewvc?rev=1135223&view=rev
Log:
CAMEL-4099: Fixed properties component not quoting replacement when using JVM or environment variables in location path. Especially a problem on Windows.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java?rev=1135223&r1=1135222&r2=1135223&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java Mon Jun 13 18:58:10 2011
@@ -170,6 +170,8 @@ public class PropertiesComponent extends
                 if (ObjectHelper.isEmpty(value)) {
                     throw new IllegalArgumentException("Cannot find system environment with key: " + key);
                 }
+                // must quoute the replacement to have it work as literal replacement
+                value = Matcher.quoteReplacement(value);
                 location = matcher.replaceFirst(value);
                 // must match again as location is changed
                 matcher = ENV_PATTERN.matcher(location);
@@ -182,6 +184,8 @@ public class PropertiesComponent extends
                 if (ObjectHelper.isEmpty(value)) {
                     throw new IllegalArgumentException("Cannot find JVM system property with key: " + key);
                 }
+                // must quoute the replacement to have it work as literal replacement
+                value = Matcher.quoteReplacement(value);
                 location = matcher.replaceFirst(value);
                 // must match again as location is changed
                 matcher = SYS_PATTERN.matcher(location);