How to get the location of confluence home directory from code?

srijani lahiri March 21, 2019

Which plugin to be used for com.atlassian.confluence.setup. Need to execute below statements to get the path for confluence home directory :slight_smile:


BootstrapManager bootstrapManager = new DefaultBootstrapManager();
String confluenceHome = bootstrapManager.getWebAppContextPath() ;

Getting below error while using com.atlassian.confluence.setup
cannot find symbol
[ERROR] symbol: class setup
[ERROR] location: package com.atlassian.confluence

1 answer

0 votes
Mehmet Şirin Usanmaz
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 22, 2019

Hi Srijani,

You can access as follows

Confluence 5.5 and earlier:

String confluenceHome = bootstrapManager.getConfluenceHome();

Confluence 5.6 and later:

String confluenceHome = bootstrapManager.getSharedHome();

or

String confluenceHome = bootstrapManager.getLocalHome();

Thanks,
Mehmet Sirin

Yagnesh Bhat
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 23, 2021

Is there any similar API for getting confluence temp directory ?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events