• Post Reply Bookmark Topic Watch Topic
  • New Topic

Parse suncertify.properties  RSS feed

Martin Wallgren
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my URLyBird assignment there is a requirement to have suncertify.properties in the current working directory.

How can I add current working directory to class path without breaking the assignment must about no other arguments than the ones specified are allowed?

Maybe there is an easy way of opening this file as a ResourceBundle even though it's not on the class path?

EDIT: no worries. Found the solution by my self. If anyone else have this question here's what I did.

URL[] url = new URL[] { new File(System.getProperty("user.dir")).toURL() }; // Current working directory

SUNCERTIFY_RESOURCE_BUNDLE = ResourceBundle.getBundle("suncertify", Locale.getDefault(), new URLClassLoader(url));
[ February 24, 2008: Message edited by: Martin Wallgren ]
Thomas Heiss
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Martin, dear valued rancher,

Why did you choose to implement reading the file suncertify.properties with the ResourceBundle classes?

Personally I am going for (or at least I want to) with java.util.Properties.

But what I did not find:
Java Util class to read key/value pairs per section.

So what I would like to have is three sections in suncertify.properties:
SERVER.host (optional if RMI supports multi network homed servers)



Properties seems to read all keys into ONE HashMap.
I would have to implement the filtering on SERVER/STANDALONE/CLIENTSERVER on my own (what a crap and this is not spec conform as java JDK classes will be preferred by SUN).

Ranchers: Is there any way to read the whole Props file per section in a Properties instance out of the box?

Best regards

Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!