This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi all. When making a JWS launched application, what do you do with external files for setup/configuration etc. I want to read, write and create arbitrary files on the file system which implies I use signed jars. (Out of the sandbox). Initially I can put my files in a jar, but I can't modify them or create new files. The application is "installed" in some JWS cache directory. Is there any way to get this install dir from the Application Laucher? Is this where I put the files? Should I put the files somewhere else, possibly determined by user interaction? How should I attack this problem? Thanks, Steffen [ January 31, 2003: Message edited by: Steffen Foldager ]
Steffen Foldager<p>Sun Certified Java Programmer<br />Sun Certified Web Component Developer
hi, any files in the jar files downloaded by java web start are in the classpath. you can use the class loader to load configuration files and copy them to the user directory for example. Chantal
Joined: Mar 22, 2001
Thanks, Chantal It makes sense. During the first run of the app I could copy the files from the jar to user.dir ("C:\Programme\Java Web Start" on my machine) in some subfolder like this: C:\Programme\Java Web Start\myApp\config\myConfig1.xml C:\Programme\Java Web Start\myApp\users\myUser1.xml (At vamphq.com (http://www.vamphq.com/jwsfaq.html#userconfig) they suggest user.home instead of user.dir, but it makes little difference whether it's one or the other.) These files will remain in the filesystem if the user "uninstalls" the app through JWS Application Manager. I don't think you can specify an uninstall class in jnlp that could remove the files. But that is not a big problem either. What is worse is that I have to keep track of all installed files whenever I do an update of the jars so I don't mess up the config folder with old versions. This implies some sort of update manager that is being run every time the application starts. The advantage with JWS being that the jars are always the latest version and the update manager should only consider files external to the jars. Of course there are alway muffins if you can live with max. 128k config files.