Pergunta

I want to implement a config for my application. Normally I would use a Properties file to maintain config values. Is that a suitable approach for app engine as well?

My concerns are:

  1. I can not write files on app engine and therefore can not change the properties file from my code?
  2. I can not easily edit the file manually without redeploying the application?

Am I missing something here or is there a better way to maintain a configuration on app engine?

Foi útil?

Solução

You could look at several options:

  • If the file is not changing, you can put the file in the WEB-INF folder and read it from there.
  • You could model your properties in the App Engine datastore and read/write from there.
  • Look at Google Cloud Storage to store and read / write the property blob.

Outras dicas

In the Datastore create an Entity whose Kind is "Properties", "Configuration", "Settings" or something like that. Your code can read and write this very easily. The content is not lost when you redeploy or change versions.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top