Re: File IO -- Reading Config Files Easily





Eric Sosman wrote On 03/30/06 13:51,:

Hal Vaughan wrote On 03/30/06 13:27,:

I remember somewhere I saw a Java program that had a config file with
name/value pairs like:

alpha=one
beta=two
gamma=three

The programmer was using something in the Java API to easily read this in
and use the value pairs for setting variables, or maybe for setting values
in something like a HashMap or Vector. I can't remember what he used or
what it was called, but it was a basic shortcut from having to read the
file line by line, split each line on the "=", and parse the results.


Sounds like java.util.prefs.Preferences.

No; wait; sorry: Preferences stores its name/value
pairs in XML format, not in plain text. Monique Mudama
is probably right: take a look at java.util.Properties.

--
Eric.Sosman@xxxxxxx

.



Relevant Pages

  • Re: some thoughts on the onlinpoker is rigged theory
    ... I guess you must be a great programer to be able to screw up the indentation ... No I didn't know software testing could be automated, ... Netscape Mail correlates strongly with being a bad programmer. ... You are apparently posting in HTML rather than plain text which is probably ...
    (rec.gambling.poker)
  • Re: Furthering my education in OOP - where/how can one learn professional skills?
    ... harder time figuring out what is going on. ... The upside of plain, procedural code is that a new ... Properly documented, OOP is *much easier* for a new programmer, because ... the code up in layers, with each layer resting on the layer below, and ...
    (comp.lang.php)
  • Re: Furthering my education in OOP - where/how can one learn professional skills?
    ... harder time figuring out what is going on. ... The upside of plain, procedural code is that a new ... programmer can usually pick it up faster. ... the code up in layers, with each layer resting on the layer below, and ...
    (comp.lang.php)
  • Re: File IO -- Reading Config Files Easily
    ... The programmer was using something in the Java API to easily read this in ... but it was a basic shortcut from having to read the ... file line by line, split each line on the "=", and parse the results. ...
    (comp.lang.java.help)
  • Re: File IO -- Reading Config Files Easily
    ... The programmer was using something in the Java API to easily read this in ... It's the Properties class - more information and sample code can be found in ...
    (comp.lang.java.help)