Variable entries in property file

Discussion in 'Java' started by frank, Jun 15, 2005.

  1. frank

    frank Guest

    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
    frank, Jun 15, 2005
    #1
    1. Advertising

  2. frank

    Lucy Guest

    "frank" <> wrote in message
    news:4NJre.7524$...
    > 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
    >

    I think there is something like "load" that will put all that is there into
    an array for you.
    Lucy, Jun 15, 2005
    #2
    1. Advertising

  3. frank

    Johan Poppe Guest

    Lucy wrote:

    >"frank" <> wrote in message
    >news:4NJre.7524$...


    >> 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.

    --
    Johan Utne Poppe
    Johan Poppe, Jun 15, 2005
    #3
  4. frank

    Dale King Guest

    Johan Poppe wrote:
    >
    > 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.

    --
    Dale King
    Dale King, Jun 16, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Laub

    Resource File mystery entries

    David Laub, Feb 19, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    498
    David Laub
    Feb 23, 2004
  2. Rick Ng Chi Wah
    Replies:
    2
    Views:
    331
    Ed Morton
    Jul 29, 2003
  3. Don Bruder
    Replies:
    3
    Views:
    954
    spikeysnack
    Aug 3, 2010
  4. Dev_SH
    Replies:
    0
    Views:
    649
    Dev_SH
    Dec 30, 2010
  5. Kyle Barbour
    Replies:
    10
    Views:
    576
    Marvin Gülker
    Aug 2, 2010
Loading...

Share This Page