Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: persistent data




On Dec 6, 2006, at 7:11 AM, Jerry wrote:


On 6 Dec 2006, at 12:13, Michael Hall wrote:

It has been indicated that the Application directory is write protected. I tend to use my own directory and application bundle to store disk data and not use the Application directory for what I write so it hasn't been a concern for me up to now. If I wanted to write it elsewhere what is now considered the preferred location? I know some java applications seem to follow a Unixy convention of writing them to the user home directory as .invisible files but I'm not sure I like that.
I should look more at the persistence API itself but I believe that isn't recommended for a lot of data and I'm not sure how much I'll need to write yet.

Don't store stuff in the application bundle - as you've found, it won't work if the Applicaiotns folder is write-protected or it's on a CD or mounted over the network. Put stuff in one of the "Library/ Application Support" folders instead, or, if it's not much, use the java.util.prefs API which will put stuff in your ~Library/ Preferences folder. Personally, I hate the hidden-files-in-the - home-folder thing.

Application Support seems a reasonable location. To start out with I'll probably use some sort of combination of simpler things in preferences and more involved things in Application Support. Although I'd assume that will be on a OS X os.name check. Any cross-platform suggestions?
The preference workspace extensions sound interesting and I would certainly consider them as an alternative when they become available although I'm not sure I want to come up with my own SPI implementation right now.


 Thanks for the suggestions.

Mike Hall        mikehall at spacestar dot net
http://www.spacestar.net/users/mikehall
http://sourceforge.net/projects/macnative



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

References: 
 >persistent data (From: Michael Hall <email@hidden>)
 >Re: persistent data (From: Jerry <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.