FELIX-2848 : Saving config file to original location shouldn't add system properties. Applying patch from Carl Hall
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1071908 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/ConfigInstaller.java b/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/ConfigInstaller.java
index e15451a..86ee1f9 100644
--- a/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/ConfigInstaller.java
+++ b/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/ConfigInstaller.java
@@ -136,9 +136,20 @@
else if( fileName.endsWith( ".config" ) )
{
OutputStream fos = new FileOutputStream( file );
+ Properties props = new Properties();
+ for( Enumeration e = dict.keys(); e.hasMoreElements(); )
+ {
+ String key = e.nextElement().toString();
+ if( !Constants.SERVICE_PID.equals(key)
+ && !ConfigurationAdmin.SERVICE_FACTORYPID.equals(key)
+ && !DirectoryWatcher.FILENAME.equals(key) )
+ {
+ props.put( key, dict.get( key ) );
+ }
+ }
try
{
- ConfigurationHandler.write( fos, dict );
+ ConfigurationHandler.write( fos, props );
}
finally
{