Java GAE Application Name

Is there a way to get the application name in Java GAE by code?

I need to configure some objects according to my application instance (production or development), and I want to create an automatic path.

+4
source share
3 answers

Try using Application ID

Vocation:

String serviceAccountName = AppIdentityServiceFactory.getAppIdentityService().getServiceAccountName(); 

serviceAccountName will be set as <app name>@appspot.gserviceaccount.com

+1
source
 String ID = SystemProperty.applicationId.get(); 

You can find more information at the following URL

https://developers.google.com/appengine/docs/java/#Java_The_environment

+2
source

This gives you the application id:

 ApiProxy.getCurrentEnvironment().getAppId() 

https://cloud.google.com/appengine/docs/java/appidentity/?csw=1#Java_Identifying_itself

+1
source

Source: https://habr.com/ru/post/1391675/


All Articles