Where is the location of the ${catalina.home} directory?

Where is the location of the ${catalina.home} directory ?

Hi James,

catalina.home stores the path to your installed Tomcat instance. If you use the standard deploy Gradle task, the path will look like the following:

\project-root\deploy\tomcat

See more info on fast deployment in Tomcat here: Fast Deployment in Tomcat - CUBA Platform. Developer’s Manual

Thanks for you reply, Olga!

By the way, I was reading about Work Directory (Work Directory - CUBA Platform. Developer’s Manual) in the documentation and another question came up:

Consider the folders below generated by the deploy task:
work/app/app-core/

I would like to create a folder named test with a file called test.txt insider app-core folder, to be accessed by a ServiceBean class in my core module.

Using my service class is there any API that allows me to access this folder ?

work/app/app-core/test/test.txt

Otherwise, what would be the best way to access a folder like that (created by me) with files inside using Cuba ?

Thank you,

James

Good question. There’s a historical inconsistency in the name of app property you need: cuba.dataDir, that’s why you didn’t find it.
You can use the getDataDir() method of GlobalConfig to access this folder.

That’s right, I could access using the code below:

 (...)

@Inject
protected Configuration configuration;

@Override
public String getRootPath() {

return "dataDir: " + configuration.getConfig(GlobalConfig.class).getDataDir();

}

Thank you, Olga

1 Like