This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I am trying to understand this requirement. Given the arrangement of the jar submission, it can behave in 3 modes and each should have a different setting associated with. however, if this jar executed in same location 3 times for different mode. Should I preserve the previous 2 settings so that any other run of a mode will conform to the setting it contains? The property.store will clear previous settings in the file.
No other thread in the forum has brought this question. So I assume that I may misunderstand something. Any comments?
My understanding is that as long as the client/server program(s) are run from the same directory, we preserve the previous settings. (SunCertify.properties to be saved/retrieved from the current directory)
Joined: May 26, 2004
Thanks for your reply. But I may not state clear about my concern. Say, the jar file is in ./
first, we run java -jar ./runme.jar server This time, the properties will store, say, db location=./db.db and port=1099.
Next we run java -jar ./runme.jar alone This time, the properties will store file location=../db.db. However, at this moment should I preserve the db location and port properties so that the next time the program running as server it will have the properties as the last time it ran as a server?
I may misunderstand you. Would you say I should preserve the server properties in this case?
Joined: Aug 27, 2003
Andy, Yes. That is the whole point of suncertify.properties file. Isn't it? We store the information that was last used/entered by the user to run the application. Instead of maintaining 3 different suncertify.properties file, We share only 1 file for the 3 modes.We can have different properties for server, client and the application in local mode but we persist them all to the same file.
For example: SERVERMODE_DB_LOCATION= SERVERMODE_PORT=
Everytime you load all the properties from the file and store them back with the modified new ones.
Joined: May 26, 2004
Thanks for your comments. Now I am crystal clear about this requirement. I think the solution is quite easy. Well this is part of our reality about this assignment: guessing the real meaning of the specification, which really turns out many interpretations and which in turn confuse a developer in many of these interpretations. I feel really lucky I came to this forum at the begining when I started my assignment.