Hayden Schiff
Hayden Schiff

Reputation: 3330

What properties file library should I use for both arrays and strings, with simple code?

I need a Java library that can handle some sort of file configuration. I need to easily be able to store both arrays and strings to it, using the simplest code possible. I don't care if it's JSON or XML or YAML, it just needs to be stored in a text file. I'm not concerned with speed or library file size, just datatype versatility and API simplicity. Any suggestions? Thanks!

Upvotes: 0

Views: 141

Answers (2)

Logan
Logan

Reputation: 2364

I used the XMLEncoder for this on something I wrote. It allows you to store entire Arrays in xml format. Apache commons configurations may be a good fit for you too as mentioned above. The XMLEnocder is nice because you can just take a java object and write it to a file. Here's a link to an example.

Upvotes: 1

HJW
HJW

Reputation: 23443

Apache commons configurations is what you need.

Upvotes: 3

Related Questions