Hi Brock,

Karaf exposes OSGi ConfigAdmin through JMX. Take a look at the MBeans under org.apache.karaf:type=config [1].

Note that .cfg files are not necessary involved. The whole .cfg files thing in Karaf is just an abstraction around OSGi ConfigAdmin provided by Felix FileInstall. Just as the Karaf config shell commands and the Karaf ConfigMBean are an abstraction around OSGi ConfigAdmin.

If you don't like working with JMX directly I suggest you look at Jolokia [2], which is a JMX-to-HTTP/JSON bridge. For example hawt.io [3] also leverages Jolokia to manage various Java frameworks including Karaf.

[1] http://karaf.apache.org/manual/latest-2.3.x/users-guide/jmx.html
[2] http://www.jolokia.org/
[3] http://hawt.io

Kind regards,

Richard Kettelerij
http://richardlog.com


On Sat, Mar 8, 2014 at 1:53 AM, Tom Leung <tom.leung@netage.com.hk> wrote:
use "ConfigAdmin" to edit properties inside the cfg file, may refer the
following link:

http://felix.apache.org/documentation/subprojects/apache-felix-config-admin.
html



-----Original Message-----
From: Brock Samson [mailto:brock.samson_@hotmail.com]
Sent: Saturday, March 08, 2014 8:40 AM
To: user@karaf.apache.org
Subject: RE: which API to edit .cfg in Karaf at runtime?

Tom,

i already have all that in place. i just need to know if there is an
existing set of APIs that supports runtime editing of a .cfg file rather
than using FileOutputStream.



--
View this message in context:
http://karaf.922171.n3.nabble.com/which-API-to-edit-cfg-in-Karaf-at-runtime-
tp4032135p4032137.html

Sent from the Karaf - User mailing list archive at Nabble.com.