简体   繁体   中英

Modifying a properties file inside a war

I understand that a properties file cannot be modified inside a war ( I cannot write to it) . my war is essentially a java wrapper to make rest calls . so essentially , I make a POST call to the app , the app does its magic makes a few calls to different services and returns the data to me in a particular format . I am using apikey authentication to communicate with the application . I now want now design a private rest call to update some of these parameters incase we need to change the apikey at a later time .

so essentially the app will read everything off an properties file . I now understand that I cannot write to a properties file when it is packaged in a war and am in quite a pickle . I cannot use a database because I am not sure which env it will be deployed to and I need it to be self contained .

Any help on how I can get over this problem will be greatly appreciated .

You can use external property files as Sajan suggested. Or use Java Preferences API

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM