• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: with java - create, read from, write to preferences file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: with java - create, read from, write to preferences file


  • Subject: Re: with java - create, read from, write to preferences file
  • From: Chris Hanson <email@hidden>
  • Date: Sun, 21 Dec 2003 11:01:17 -0600

On Dec 21, 2003, at 5:10 AM, Matthias Edrich wrote:
I want to have the application store the path to that
file in a preferences file (preferences file to be located in
the user's preferences folder).

Don't store paths on Mac OS X. Store an NSData containing an alias record. My free BDAlias class makes this easy.

http://bdistributed.com/Projects/BDAlias/

How do I create a preferences file for my application
in the preferences folder if no such file exists?

[snip]

How do I read and write contents from and to this preferences file?

NSUserDefaults. You don't do anything with the file, you use a higher-level API.

For example, I want to get the path to the XML file.
(I store that path within the preferences file)

Don't store paths. See above for BDAlias.

How do I parse an XML with Java? Are there any special
classes already available which help in getting content
from between XML tags?

Yes, about a billion. ;) There are a large number of XML parsing frameworks for Java, some of which are included with Panther and Java 1.4.1. Sorry I can't name them off the top of my head, but I suggest poking around in the documentation.

-- Chris

--
Chris Hanson <email@hidden>
Weblog: http://www.livejournal.com/users/chanson/
Resume: http://bdistributed.com/people/cmh/resume.html
Looking for work developing Java or Mac OS X applications
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: with java - create, read from, write to preferences file
      • From: p3consulting <email@hidden>
References: 
 >with java - create, read from, write to preferences file (From: Matthias Edrich <email@hidden>)

  • Prev by Date: Re: Adding "Bindings"
  • Next by Date: [anOpenPanel filename] won't work after XCode 1.1 update
  • Previous by thread: with java - create, read from, write to preferences file
  • Next by thread: Re: with java - create, read from, write to preferences file
  • Index(es):
    • Date
    • Thread