Updating config file inside a jar programatically

可紊 提交于 2019-12-12 02:05:40

问题


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?

来源:https://stackoverflow.com/questions/28054155/updating-config-file-inside-a-jar-programatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!