Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Application name on Java GAE

There is any way to get by code the application name on Java GAE?

I need to configure some objects according with my application instance (production or development), and I want to build a automatic way.

like image 980
Victor Avatar asked Oct 08 '22 23:10

Victor


2 Answers

String ID = SystemProperty.applicationId.get();

You can find more details at the following URL

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

like image 61
user2530129 Avatar answered Oct 13 '22 12:10

user2530129


Try using App Identity

Calling:

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

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

like image 37
Shay Erlichmen Avatar answered Oct 13 '22 11:10

Shay Erlichmen