Deprecated class org.apache.sling.commons.osgi.OsgiUtil | Community
Skip to main content
Level 2
October 16, 2015
Solved

Deprecated class org.apache.sling.commons.osgi.OsgiUtil

  • October 16, 2015
  • 1 reply
  • 1408 views

Hello,

 

the class org.apache.sling.commons.osgi.OsgiUtil is deprected. But which class should I use instead of OsgiUtil?

 

regards

Reini

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Gregor_Zurowski

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

1 reply

Gregor_Zurowski
Gregor_ZurowskiAccepted solution
Level 2
October 16, 2015

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