[Rpm-maint] read rpm database with Java
pmatilai at redhat.com
Wed Jun 4 14:20:38 UTC 2014
On 06/04/2014 03:34 PM, Peter Penzov wrote:
> Hi, thank you for the answer but I didn't understand much of your comment.
> In general what are the ways to read rpm database with Java?
In general to perform tasks / access services of a program written in
another language there are roughly three options which are in no way
specific to rpm or Java, each with their pros and cons:
1) Shell out to call command line utilities, parse output
2) Use language bindings to access the other programs library
3) (Try to) reimplement the whole thing in in the language
1) is typically by far the least amount of work, but also the most
limited in what can be achieved. Since 2) doesn't exist for Java AFAIK,
you'd need to implement the bindings on your own, and is going to be
non-trivial amount of work. 3) is the route taken by jrpm (AFAIK) and is
obviously by far the biggest amount of work and guaranteed to be more or
less incompatible forevermore for anything non-trivial such as rpm
Whatever works best depends on the situation. I wont be able to tell you
how to do any of that in Java though.
- Panu -
More information about the Rpm-maint