• 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
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

.preperties file

 
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am doing the "Bodgitt and Scarper" assignment,and it mentioned the following about the .properties file :

All configuration must be done via a GUI, and must be persistent between runs of the program. Such configuration information must be stored in a file called suncertify.properties which must be located in the current working directory.



What is meant by the working directory??
In my applicaition i used suncertify.executer.Runner class to start
the application (either the server or the client).Is the working directory where the main class will reside.
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, the working directory is the directory where the user places the runme.jar file.

Suppose the user places the runme.jar file in /usr/local/SunCertify, then the properties file should be saved in that directory.

As far as I understand...
 
Jar Jaquiso
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ops, seems I was mistaken. Have a look at:

https://coderanch.com/t/186804/java-developer-SCJD/certification/Intelligent-Current-Working-Directory

and

https://coderanch.com/t/187048/java-developer-SCJD/certification/properties-file

It is quite well explained.

 
Khaled Mahmoud
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The assignment says that the user settings must be saved between different runs of the applications.
It also says that the .properties file must be in the current working directory.
If a user changes the directory from where he or she runs the jar file,the current working directory will change and the configuration will not be saved.
I saw the post that your link points to.This post says that create an outstrem of the file.This will create a new file if the file does not exist.If use changes the working directory so much,the settings will not
be saved.
[ October 23, 2006: Message edited by: Khaled Mahmoud ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic