🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #15100

Re: Reading INI files.

#15100
From: Pascal Warnimont
Date: Thu, 08 Jul 1999 00:00
41 lines
1844 bytes
Here 's some code that might give you ideas .

With the JDK1.1.6, the Properties.load  is able to read file of the type :

propertyName=  propertyValue
propertyName1=  propertyValue1
....

on both mac and PC (ie  the end of line can be \n or \r or both).

No method has been deprecated, but I haven't checked the implementation
changes.

Of course it is not as structured as an INI  file (ie no section).

But maybe you can reuse and modify the existing  (java) code ( I' d be
interested if you do it).

The save method uses the \n as end line wich read ok on PC though it is on
one line. I haven't tested it on mac, as I only need reading for the moment.
In the  same line of idea it is probably easy to extend Property to use a
 system dependant) String getEndOfLineString().

Let me know if you do.

I know properties should be serialized and unicode is better  than character
set ( haa yes accent are not the same in Mac and PC, this is another
limitation of the above method), but for the moment, I have written nor
found a Property editor, nor a unicode file editor.



Eric Advincula wrote in message <7lga7t$17e3@forums.borland.com>...
>I need to read ini files and I was wondering if there is a specific class
to
>do this or do I just use the File IO class?  Couldnt find info on it in the
>api's
>
>Thanks
>
>
Technical Details
Message-ID: <7m2gmg$hqs2@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7lga7t$17e3@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,c248fdff5160d5e3
X-Google-Attributes: gidf74b3,public
From: "Pascal Warnimont" <pwa@endless-interactive.com>
Subject: Re: Reading INI files.
Date: 1999/07/08
Message-ID: <7m2gmg$hqs2@forums.borland.com>
X-Deja-AN: 498679377
References: <7lga7t$17e3@forums.borland.com>
Organization: Endless-interactive
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Newsgroups: borland.public.jbuilder.java.language