Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static String getMainAppPath() {
- String currentEnvironment = ContextBean.getCurrent().getEnvironment();
- if (currentEnvironment.equalsIgnoreCase("PRODUCTION")) {
- return PROD_APP_PATH;
- } else if (currentEnvironment.equalsIgnoreCase("STAGING")) {
- return STAGING_APP_PATH;
- } else {
- return LOCAL_APP_PATH;
- }
- }
- public String getEnvironment() {
- if (null == environment) {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- ExternalContext externalContext = facesContext.getExternalContext();
- String url = ((HttpServletRequest)externalContext.getRequest()).getRequestURL().toString();
- if (url.contains("prod.traxxeo.com"))
- environment = "PRODUCTION";
- else if (url.contains("staging.traxxeo.com"))
- environment = "STAGING";
- else
- environment = "LOCAL";
- }
- return environment;
- }
- i mi vadi NPE naContextBean.getCurrent()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement