You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by fm...@apache.org on 2011/07/07 13:49:16 UTC

svn commit: r1143777 - /felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java

Author: fmeschbe
Date: Thu Jul  7 11:49:16 2011
New Revision: 1143777

URL: http://svn.apache.org/viewvc?rev=1143777&view=rev
Log:
FELIX-3028 Better handle some situations around clearing the bundle location of a configuration.

Modified:
    felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java

Modified: felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java?rev=1143777&r1=1143776&r2=1143777&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java (original)
+++ felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManager.java Thu Jul  7 11:49:16 2011
@@ -149,9 +149,23 @@ public class ConfigManager extends Confi
         // check for configuration unbinding
         if ( request.getParameter( "unbind" ) != null )
         {
-            config.setBundleLocation( null );
-            response.setContentType("text/plain");
-            response.getWriter().print("true");
+            if ( config != null && config.getBundleLocation() != null )
+            {
+                config.setBundleLocation( null );
+
+                // workaround for Felix Config Admin 1.2.8 not clearing dynamic
+                // bundle location when clearing static bundle location. In
+                // this case we first set the static bundle location to the
+                // dynamic bundle location and then try to set both to null
+                if ( config.getBundleLocation() != null )
+                {
+                    config.setBundleLocation( "??invalid:bundle/location" );
+                    config.setBundleLocation( null );
+                }
+            }
+            response.setContentType( "application/json" );
+            response.setCharacterEncoding( "UTF-8" );
+            response.getWriter().print( "{ \"status\": true }" );
             return;
         }