Java check deployment mode

1
I migrated a 2.3.3 project to 2.5.3. I have the following javacode: String m = Core.getMode().toString(); if ("PRODUCTION".equals(m)) { path.append("/srv/mxinstances/projectprod/"); } else if ("ACCEPTATION".equals(m)) { path.append("/srv/mxinstances/projecttest/"); } this doesn't work anymore. is there another way to do this?
asked
1 answers
5

It's not recommended to use absolute paths to determine where resources are. In 2.5 you can access your resource folder by calling Core.getConfiguration.getResourcePath(). This way you can use relative paths starting from the resource folder.

answered