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 2019/09/26 05:00:00 UTC
[camel] 05/10: CAMEL-13947: PropertiesComponent should be a static
service and resolved like other similar features.
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch CAMEL-13947
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 289fbfe7ee08e65077db22d6256e877d3ca25868
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Sep 25 20:00:02 2019 +0200
CAMEL-13947: PropertiesComponent should be a static service and resolved like other similar features.
---
.../src/main/java/org/apache/camel/spi/PropertiesComponent.java | 2 ++
.../camel/component/properties/PropertiesComponentEncodingTest.java | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/core/camel-api/src/main/java/org/apache/camel/spi/PropertiesComponent.java b/core/camel-api/src/main/java/org/apache/camel/spi/PropertiesComponent.java
index 362497b..7277893 100644
--- a/core/camel-api/src/main/java/org/apache/camel/spi/PropertiesComponent.java
+++ b/core/camel-api/src/main/java/org/apache/camel/spi/PropertiesComponent.java
@@ -126,6 +126,8 @@ public interface PropertiesComponent extends StaticService {
* <p/>
* If no encoding has been set, then the properties files is loaded using ISO-8859-1 encoding (latin-1)
* as documented by {@link java.util.Properties#load(java.io.InputStream)}
+ * <p/>
+ * Important you must set encoding before setting locations.
*/
void setEncoding(String encoding);
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentEncodingTest.java b/core/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentEncodingTest.java
index c216e65..3067256 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentEncodingTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/properties/PropertiesComponentEncodingTest.java
@@ -47,8 +47,8 @@ public class PropertiesComponentEncodingTest extends ContextTestSupport {
@Override
protected CamelContext createCamelContext() throws Exception {
CamelContext context = super.createCamelContext();
- context.getPropertiesComponent().setLocation("classpath:org/apache/camel/component/properties/myutf8.properties");
context.getPropertiesComponent().setEncoding("UTF-8");
+ context.getPropertiesComponent().setLocation("classpath:org/apache/camel/component/properties/myutf8.properties");
return context;
}