Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to read confluence home directory path?

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 

BootstrapManager bootstrapManager = new DefaultBootstrapManager();

 confluenceHome = bootstrapManager.getSharedHome();

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

 

I have also used the below code snippet to get the confluence directory path , but getting null as return from method getApplicationHome()

AtlassianBootstrapManager bootstrapManager = new DefaultAtlassianBootstrapManager();

String confluenceHome = bootstrapManager.getApplicationHome();

2 answers

0 votes
Bill Bailey
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

How about:

String baseUrl = settingsManager.getGlobalSettings().getBaseUrl()

 From this link

how-do-i-get-the-base-url-and-contextpath-of-a-confluence-installation/

srijani lahiri March 22, 2019

Thanks... I will try and will let you know.

srijani lahiri March 22, 2019

Tried to use the below code as per the link provided by you :

SettingsManager settingsMngr = new DefaultSettingsManager();
String confluenceHome = settingsManager.getGlobalSettings().getBaseUrl();

 

For SettingsManager added the package import com.atlassian.confluence.setup.settings;

But got below error  while compiling:

cannot find symbol
[ERROR] symbol: class settings
[ERROR] location: package com.atlassian.confluence.setup

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
srijani lahiri March 22, 2019

Hi,

I have tried using the same. It gives me below error while compiling :

 

BootstrapManager bootstrapManager = new DefaultBootstrapManager();

 confluenceHome = bootstrapManager.getSharedHome();

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events