java - Not able to write : in Property file -


in application user can change propery file.. text contains : colon. while using obj.setproperty("key","value") passes \:

please find below example code , needful.

string url="http://google.co.in"; properties p=new properties(); fileoutputstream o=new fileoutputstream("abc.properties"); p.setproperties("testurl",url); p.store(o,null); o.close(); 

thank praveenkumar v

refer properties class's store method api. says characters #, !, =, , : saved escaping backslash.

the key , element characters #, !, =, , : written preceding backslash ensure loaded.

if read saved file load method in properties class, there no problem. if not, you'll have write own custom code escape these characters while loading.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -