Writing object to file

My dilemma is i am wanting to write an arraylist to a specific folder within the package mounted in Netbeans. My only problem is I am running on a mac and cannot get to write to correct place. I have tried to use /.../file name etc. It works if i explicitly give the whole path but i do not want to do this as this app will need to transportable to other machines. Any help please.

Thanks

Chad

[412 byte] By [chad25a] at [2007-11-26 21:44:47]
# 1
Try using the System.getProperty() method. the "user.home" property will point to the user's Home directory, no matter what platform you're running. A lot of Java programs just use that directory for data files.
kevjavaa at 2007-7-10 3:32:54 > top of Java-index,Java Essentials,New To Java...
# 2
Would you be willing to give a generic example the setup of using your technique?ThanksChad
chad25a at 2007-7-10 3:32:54 > top of Java-index,Java Essentials,New To Java...
# 3
Sure, here's a basic example of achieving a common directory in Mac, Win, and Unix: http://home.subnet.at/peter/2006/04/where-am-i-operating-system-detection-with-java/
kevjavaa at 2007-7-10 3:32:54 > top of Java-index,Java Essentials,New To Java...
# 4
Thanks for the link. I will give it a shotChad
chad25a at 2007-7-10 3:32:54 > top of Java-index,Java Essentials,New To Java...
# 5

I tried you suggestion and it works good for getting to the users home folder but I am wanting to contain the resource data file all within the same package. ie... Folder contains all .java files and any resource folders needed. I can get the resource just fine using getClass().getResourceAsStream() but when i write out i get errors. I am using

Is there something like the getClass... that mimics writing out to files. I am also using a mac and only plan on distributing this to other macs only.

Thanks

Chad

chad25a at 2007-7-10 3:32:54 > top of Java-index,Java Essentials,New To Java...