wood burning stoves*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes suncertify.properties Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "suncertify.properties" Watch "suncertify.properties" New topic
Author

suncertify.properties

Wickes Potgieter
Ranch Hand

Joined: Apr 05, 2002
Posts: 68
Hi,

My spec specifies the following:

"Such configuration information MUST be stored in a file called suncertify.properties which MUST be located in the current working directory."

The current working directory that they are mentioning above, where will that be? Also, do I hard-code string values for Text on buttons, etc. or do I put them in this properties file and set them at runtime after reading the properties file?

Thanks in advance!


Wickes Potgieter<br />SCJP<br />BEA Certified Specialist: Server, Integration, Portal, Tuxedo<br />BEA WebLogic Server 7 Certified Enterprise Developer<br />BEA Certified Architect<br /><a href="http://www.bea.com" target="_blank" rel="nofollow">www.bea.com</a>
Jashua Ni
Greenhorn

Joined: Jul 31, 2004
Posts: 17
To my understanding, you don't create this file manually when you coding, this file will only exist after user starts the application.

for the button text, what do you think, this is part of the design, and this application is not going to serve other purpose, do you think it need such dynamic approach? By the way, doing the releasing, put in the property file and hard code in the source, I don't see any difference.

thanks,
Wickes Potgieter
Ranch Hand

Joined: Apr 05, 2002
Posts: 68
Where do you create the file then? Do you specify the path?
Jashua Ni
Greenhorn

Joined: Jul 31, 2004
Posts: 17
You can specify the relative path as always the better approach. Acturally tell you the file will be in the working directory is giving you the hint.

Hope this helps,

thanks,
peter wooster
Ranch Hand

Joined: Jun 13, 2004
Posts: 1033
Originally posted by Wickes Potgieter:
Hi,

My spec specifies the following:

"Such configuration information MUST be stored in a file called suncertify.properties which MUST be located in the current working directory."

The current working directory that they are mentioning above, where will that be? Also, do I hard-code string values for Text on buttons, etc. or do I put them in this properties file and set them at runtime after reading the properties file?

Thanks in advance!


I'm just starting on this, so I'm no expert on the project. But if I read "current working directory", I would expect that to mean the directory from which the program was started. Putting the properties there means that if you start the program from a different directory you would be able to have a different set of properties. This directory can be obtained from System.getProperty("user.dir");.
peter wooster
Ranch Hand

Joined: Jun 13, 2004
Posts: 1033
If you try the following code you will see that files created with relative paths use the current working directory and that the "user.dir" is the same as that directory.


In real projects that we do at work we often use the current directory for properties, the other choice we use is to get a property file name from a command line argument, this lets us configure multiple versions of the same program by setting the command line in the shortcut in Windows or script in Unix, but this project doesn't require that. We also always have a set of default properties in the program or its jar file.
[ July 31, 2004: Message edited by: peter wooster ]
Wickes Potgieter
Ranch Hand

Joined: Apr 05, 2002
Posts: 68
Thank you for the reply!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: suncertify.properties