Hello,
the class org.apache.sling.commons.osgi.OsgiUtil is deprected. But which class should I use instead of OsgiUtil?
regards
Reini
Solved! Go to Solution.
Hi Reinhard:
You can use PropertiesUtil and ServiceUtil that contain all methods that are now deprecated in OsgiUtil. Both are located in the org.apache.sling.commons.osgi package.
E.g.:
The call to OsgiUtil:
String myProperty = OsgiUtil.toString(propValue, defaultValue);
...can be simply replaced with:
String myProperty = PropertiesUtil.toString(propValue, defaultValue);
Hope this helps,
Gregor
Hi Reinhard:
You can use PropertiesUtil and ServiceUtil that contain all methods that are now deprecated in OsgiUtil. Both are located in the org.apache.sling.commons.osgi package.
E.g.:
The call to OsgiUtil:
String myProperty = OsgiUtil.toString(propValue, defaultValue);
...can be simply replaced with:
String myProperty = PropertiesUtil.toString(propValue, defaultValue);
Hope this helps,
Gregor