Catalina.home app-properties

Hi Guys,

I have set: cuba.fileStorageDir=E:/resources/DARYN_CUBA/FILE_STORAGE in app.properties

I am just wondering if it is possible to set the property to automatically find the directory one level up from the deploy one. i.e. the project directory.

This is because I develop on windows and my production is on linux and I don’t want to have to keep changing the value depending on which environment I am in.

Hello.

I think you can use this snippet to locate Tomcat’s path and then just append correct part:

// returns, for example, "/home/username/env/tomcat"
String tomcatPath = AppContext.getProperty("catalina.home");

Best regards,
Daniil.