How to read OSX .plist files from Java?
plist - The primary property list for Mac OS X applications, located in the /Contents/ directory of an . APP bundle. To view this file, right-click an application file, select "Show Package Contents," and open the Contents folder.
Open the plist file /Library/Preferences/com. apple. dock. plist in Xcode and use the editor to view and change values.
Plist files are Mac files that allow you to save preferences in the apps you use. Occasionally they may need to be deleted to restore proper functionality to a program experiencing a conflict. You'll want to follow these steps when another article or situation calls for deleting your . plist file.
Imho running a commandline tool from Java is not quite the "best way to do the job".
There are several much better ways to deal with binary plist in JAVA: That one I prefere is an usefull little project by Daniel Dreibrodt at: google project hosting
You can also use Apache Commons Configuration (which API is supporting the Property List format). More information about the history of the .plist-format on OSX (which version introduced which format) I wrote up on my blog
Update: There is a new project hosted at source forge called Property List Library, that shall be able to read AND write .plist- I have not tested it, but it sounds interesting.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With