Skip to main content
2 of 2
Added detail
  • 144k
  • 22
  • 188
  • 471

Here is a far and away superior solution: use java.util.Properties to handle your configuration file. Properties supports a key=value syntax that is very similar to the one you are trying to parse. It's up to you to decide whether that syntax is close enough to handle any existing configuration files you might have, and whether the validation and logging in your current code are essential.

  • 1.5k
  • 8
  • 12