I have a directory containing both Zip & Rar archives. I already have a way to get a zip file's comment -
if (f.getName().substring(f.getName().length() - 3).equals("zip")) {
ZipFile zip = new ZipFile(f);
zip.getComment();
}
Is there a way to do the same thing on a Rar file?
note that:
Thanks in advance!
I think in the end, you are looking for some sort of library to get that done for you. Like raroscope or java-unrar.
Alternatively, you could decide to re-invent that wheel yourself (not recommended).
Or you simply run the command line rar tool using ProcessBuilder (as a system command), like explained here.