Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2005

Tip: Looking for answers? Try searching our database.

Variable entries in property file

Thread view: 
frank - 15 Jun 2005 00:31 GMT
Variable entries in property file

I was wondering is there a good way to setup and read in variable
entries in a property file? I wasn’t to have from 1-many Ip/port value
pairs but won’t know in the program how many their might be

Example:
Ip1=128.1.1.1
Por1t=2001
Ip2=128.1.1.2
Port2=2002
Ip3=128.1.1.3
Port3=2001

Thanks,

Frank
Lucy - 15 Jun 2005 00:54 GMT
> Variable entries in property file
>
[quoted text clipped - 13 lines]
>
> Frank

I think there is something like "load" that will put all that is there into
an array for you.
Johan Poppe - 15 Jun 2005 09:16 GMT
Lucy wrote:

>> I was wondering is there a good way to setup and read in variable
>> entries in a property file?
...
>I think there is something like "load" that will put all that is there into
>an array for you.

You are thinking of java.util.Properties. It is basically a HashMap
with "load" and "save" methods to read and write property files, and
should do the job for the original poster.

Signature

 Johan Utne Poppe

Dale King - 16 Jun 2005 14:33 GMT
> You are thinking of java.util.Properties. It is basically a HashMap
> with "load" and "save" methods to read and write property files, and
> should do the job for the original poster.

Actually it is a subclass of Hashtable. It is a very good example of
inappropriate use of inheritance when containment was the better answer.

Signature

 Dale King



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.