btran007 wrote:The answers to both your questions are 'no'. Resources within Jar files are accessed by URL, something like..
..The app uses common File IO such as File, FileReader, and BufferedReader. Would that work or I have to use JNLP API?
I am not sure from your description if you mean that the main Jar contains other Jars. That will not work. If the app. uses multiple Jars, just add multiple <jar ...> elements in the JNLP.
URL urlToResource = this.getClass().getResource("/launch.html"); InputStream is = urlToResource.openStream(); InputStreamReader isr = new InputStreamReader(is); // ...
btran007 wrote:Your analysis is wrong. All the resources in Jars listied in the resource section of the JNLP file are cached on the local machine. I could tell you, as the administrator of your own machine, how to find them.
...I have a perfectly working desktop app with local folders and files which it accesses. Now I want to JAR/WAR and deploy as Web Start because it's dynamic and convenient. Now it is deployed and user clicks on the link to download it and run. I assume that the app is downloaded and installed somewhere on user local machine but that is not the case, just a reference to the jnlp file.
..Then how does the app access its resources (beside JAR)? I would like to open and update or create new resources.Opening we have covered. Updating or creating is more tricky.
..I don't think it's possible. ..You seem to think a lot of things that are wrong. What is the nature of the things you wish to 'update or create'? Be as clear & specific as possible. I need to know the size and general nature of these resources.
..Someone please response.Odd words, coming from someone who took 3&1/2 days to reply to the first response. ;)
btran007 wrote:This is a bit confusing. Why does a 'folder' (or directory as it is more commonly known across systems) contain a /META-INF directory? What is inside that directory?
..The app folder contains app.jar, app.properties, paths.txt, stderr.txt, stdout.txt, /doc, /grids, /lib, /META-INF.
..app.properties is read first upon load. paths.txt is updated anytime by user(s). stderr.txt and stdout.txt are created for standard errors and outputs (this can be on local machine). /docs ../docs or /doc? Accuracy is important in programing. Even more important when seeking help over the web on international forums.
..are just user manual in pdf and html. /grids are grid files used as inputs. ...Put the app.properties into the Jar.
btran007 wrote:Oops! I meant a+ Jar file. My bad. But then, it is listed in the 'resources' section of the JNLP, not the 'resource' section. ;)
..I took your advice and have everything in the jar file. ..
..Now it seems to work because getClass().getResource() only work with files and directories in the jar file. However, is it possible to have /doc and /grids outside of jar?..You can put them in doc.jar and grids.jar. JWS will check all Jars against the times of the Jars on the server and download only the ones that are newer than the local copies. Automatic update is one of the key selling features of JWS.
..adding new files on the web server so they can be shared.Umm.. OK. How does your..
..perfectly working desktop app ....do it?
btran007 wrote:Oh ..right. In that case, do not create files with either no path or a hard coded path that comes from you. Use ..
..I found one thing peculiar how the way Firefox and IE create files on local machine. This app, when open in IE the files are created on user's desktop. However, Firefox create the files under c:\program files\mozilla firefox. Because I don't have write permission to the directory the application bombs. I need to modify the file location but I am afraid of hard coding.
..as the initial path and preferably put them in a sub-directory.