tags:

views:

913

answers:

2

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
Actually starting with Mac OS X 10.4 the default format for .plist files is in binary form not in xml form
jitter
+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).

  1. Determine if the file is in XML or binary format
  2. If in binary format use the plutil command-line-utility to convert file to xml format
  3. Now you have the file in xml format, use any java-xml-library to handle the plist
jitter