Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 247
  • Last Modified:

Using properties.store just re-arranged the parameters

I need a way to store and retrieve parameters from a config. file using java Properties but keeping the order, line spaces and comments in the configuration files.

Thanks,
B.T
0
bachra04
Asked:
bachra04
  • 5
1 Solution
 
objectsCommented:
then you'll need to load it yourself into a LinkedHashMap
0
 
objectsCommented:
Maybe even an ArrayList if you want to also store the comment.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
bachra04Author Commented:
what about the comments and spaces between lines that I want to keep.
0
 
objectsCommented:
you can use split to split the lines

String[] keyvalue = line.split("=");
String key = keyvalue[0];
String value = keyvalue[1];
0
 
objectsCommented:
> what about the comments and spaces between lines that I want to keep.

thats why i said you may need to use a List
see the link for how to read file into list
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now