• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

suncertify.properties

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where do you create the file then? Do you specify the path?
 
Jashua Ni
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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,
 
Ranch Hand
Posts: 1033
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 1033
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for the reply!
 
reply
    Bookmark Topic Watch Topic
  • New Topic