How to read OSX .plist files from Java? Thank you in advance!
A:
You should probably explain for readers what a .plist file is. It's a Mac file which is, as I understand, an XML-based format in its current incarnation. So, simply use Java's built in XML processing libraries to read it.
But perhaps you should also say what you mean by 'read' -- simply get it into memory, parse it, what?
Sean Owen
2009-11-17 14:25:19
Actually starting with Mac OS X 10.4 the default format for .plist files is in binary form not in xml form
jitter
2009-11-17 14:27:26
+4
A:
I guess you refer to the plist format used on Mac starting with Mac OS X (and not the NeXTSTEP or GNUstep format).
- Determine if the file is in XML or binary format
- If in binary format use the
plutil
command-line-utility to convert file to xml format - Now you have the file in xml format, use any java-xml-library to handle the plist
jitter
2009-11-17 14:25:59