Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

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

Avatar

Avatar
Validate 1
Level 2
Reini-
Level 2

Likes

4 likes

Total Posts

21 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
Reini-
Level 2

Likes

4 likes

Total Posts

21 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
Reini-
Level 2

15-10-2015

Hello,

 

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

 

regards

Reini

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 5
Level 2
Gregor_Zurowski
Level 2

Likes

5 likes

Total Posts

5 posts

Correct Reply

3 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 3
Affirm 1
View profile

Avatar
Boost 5
Level 2
Gregor_Zurowski
Level 2

Likes

5 likes

Total Posts

5 posts

Correct Reply

3 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 3
Affirm 1
View profile
Gregor_Zurowski
Level 2

15-10-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

Answers (0)