commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Robinson <>
Subject [Configuration] Call me a moron, but I just can't make it work!
Date Mon, 14 Jul 2008 14:02:16 GMT

I'm writing a program that must load, search, edit and save Mac OS X  
plist files.

I was attempting to use apple's NS* foundation classes, but I couldn't  
work out how to write to the plist files (maybe I'm just stupid).

I searched around the internet and was overjoyed to find  

I've played with it for the past few days, trying to figure out how  
I'm meant to get data out of the plist files I'm working with.

So far, nothing I've tried has worked:


XMLPropertyListConfiguration sigh = new  


System.out.println(sigh.containsKey("SandwichFillings"));	//this  
prints "true" - great!

	//What I actually want, is the "SidebarTitle" string.  When I try:




//or any other combination that I could think of - I get false.


If I save the file with a different name, I can open it and see that  
the information has all been copied correctly.

I just haven't been able to figure out how to access/edit information  
in the file.

For the past two days I've been trawling the internet and trying  
everything I could think of, but I am yet to succeed.

Is what I want to do even possible?  If so, please tell me how!   
Please!  It's been driving me insane.

This is an example of the files I'll be reading (currently I want to  
get key = SidebarTitle, and change its value).


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "

<plist version="1.0">
				<string>SIDE TITLE</string>
	<string>Page Attributes</string>


I'm using Netbeans 6.01 with Mavenide, Maven2.  I get no errors at  
compile time, no error during my attempts to get the key/value (unless  
one counts "null" when you know it's damn-well there as an error!).

Thank you for taking the time to read my message,


-	-	-
Everything is gone;
Your life's work has been destroyed.
Squeeze trigger (yes/no)?
-	-	-
David Carlson
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message