Updating config file inside a jar programatically

2019-09-19 07:13发布

I'm writing a converter which should convert file A to file B. Doing so, I'm using the config API from Apache Commons Configuration to filter those files so not every entry will be converted.

Now I made a jar file which has the config file inside it. Reading from this config file inside the jar is no problem but if I try to use the save() method I'll get a ConfigurationException: no file name has been set message.

If I try to set the file name programmatically the program throws a NullPointerException.

So my question is: can I modify an e.g. config.properties file inside my jar in a programatic way?

0条回答
登录 后发表回答