aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes suncertify.properties format? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "suncertify.properties format?" Watch "suncertify.properties format?" New topic
Author

suncertify.properties format?

Lonesha Akaaba
Greenhorn

Joined: Sep 21, 2009
Posts: 4
Hi all!

Very quick question... Is the format of the suncertify.properties file restricted in any way? I'm asking because I'd rather work with preferences than properties and so, I want to populate the file with XML.

Your thoughts?
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2246

Howdy, partner! Welcome to JavaRanch!

Champion, you have to store the properties that your program require in a file called suncertify.properties that must be saved in the folder in which the application is running. This is a must. And you may define the properties that your program will require, according to its needs.


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
satishkumar janakiraman
Ranch Hand

Joined: May 03, 2004
Posts: 334
Hi,


I am not sure about the format but I am sure that XML style tags should not be used and also your file name must be suncertify.properties.

sat
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 4908
    
  10

Hi,

You have to store the configuration settings in suncertify.properties and that is a must. I don't think there is a must on how the data should be stored, so xml, plain text, binary,... everything is allowed.

But of course why making it hard for yourself, if there is a Java class which is made perfectly for the job (java.util.Properties): loading, saving, retrieving properties is as simple as possible with this class.

Kind regards,
Roel


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Lonesha Akaaba
Greenhorn

Joined: Sep 21, 2009
Posts: 4
Hello again...

Yes, I understand the requirements (storing properties the app requires in the file, in the current directory, etc) and that there is a Properties class. The reason why I want to use preferences is because it provides a clean way to separate my client properties from the server ones (by specifying the parent node). For example, I can write out changed client properties without having to code the logic to skip properties that only apply to the server (because I have them in separate nodes)... Does this help explain my question more?

My original question is really will I be penalized (failed) if the contents are XML?
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 4908
    
  10

Hi Lonesha,

With this code I set 2 properties and save it to file:


Like I previously said: I think you are making it more difficult than it should be. But there is no requirement about how the properties (format) are saved in the suncertify.properties, so if you prefer XML just use it.

Kind regards,
Roel
Lonesha Akaaba
Greenhorn

Joined: Sep 21, 2009
Posts: 4
Hey Roel... you're still not understanding me... I know how to set properties... the problem with your example is that I have properties specific to the server and another set specific to the client. Because they are both in one file (per the requirements), if I only want to load and/or write those specific to the client, it requires additional code. There isn't (at least I haven't found it) a way of specifying the "group".... So, when I write client prop changes back to the file, I either have to deal with the server ones or lose them... and the reverse is true when working with the server props...

Hopefully this example will help
- client properties
-- show splash screen
-- database location (server remote or local)
-- database file (only valid when server is local)
--- etc
- server properties
-- database file
-- port
--- etc


Thanks for your responses.
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11278
    
  59

Roel De Nijs wrote:With this code I set 2 properties and save it to file ...

Which is not that much different to an XML version:

Realistically therefore, I think there should be no problems using the XML format of a standard properties file if you desire.


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 4908
    
  10

Hi Lonesha,

You don't lose properties. When you load the properties, it loads all properties in that file. And if you store the properties object, all properties are saved.

A small example:


Kind regards,
Roel

Lonesha Akaaba
Greenhorn

Joined: Sep 21, 2009
Posts: 4
Thanks. I'll stick with what I have
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: suncertify.properties format?
 
Similar Threads
[URLyBird] What are the persistent properties
non java files in the code direcotry, a deploy question
DBAccess & suncertify.properties not found in the Assignment jar
I am close to submit - question about suncertify.properties
B&S: How to use suncertify.properties ?