Koottan
Koottan

Reputation: 87

Java apis to query RPM package information for file

In Linux, RPM package information for a file can be determined using the 'rpm -qf' option. Is anyone aware of a JAVA library which supports these kind of operations?

E.g.:

/bin # rpm -qf grep
grep-2.7-5.7.1

Upvotes: 4

Views: 943

Answers (2)

Peter Becker
Peter Becker

Reputation: 8855

There is Redline RPM, which has a Scanner that might do what you want. I've used it to package RPMs via Ant/Maven, but never to read them.

Upvotes: 2

Lev
Lev

Reputation: 100

I am unaware of any library that provides an easy API to check RPM package info. You can, however, use Java to execute shell commands and interpret their results.

Some more info:

Upvotes: 2

Related Questions