File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

writing to jar file

 
Joe McIntyre
Ranch Hand
Posts: 121
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm developing a desktop app in NetBeans. Currently, when I run the program from within the NetBeans environment, it uses (I think) the build folder, which does not have everything packaged in a jar file. So I can write to any of those folders that correspond to package names in my application. But what will happen when I package the whole thing in a jar file for deployment? I can't write to a file that is stored in that jar file can I? Is there a standard solution for this problem?

Thanks.
 
Joe Ess
Bartender
Posts: 9214
9
Linux Mac OS X Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Wally Flint:
I can't write to a file that is stored in that jar file can I?

No.

Originally posted by Wally Flint:

Is there a standard solution for this problem?

That depends on what you are trying to do.
 
Joe McIntyre
Ranch Hand
Posts: 121
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, suppose I just want to save some application preferences... what would I do then?
 
Joe Ess
Bartender
Posts: 9214
9
Linux Mac OS X Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A good place to do that is in the user home directory.
You can get that through the java.lang.System.getProperties() method.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That sounds like a case for the Preferences API.
 
Joe McIntyre
Ranch Hand
Posts: 121
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic