How do I get the base URL of a Bamboo installation?

How do I get the base URL and ContextPath of a Confluence installation?
I tried with the following code but it gives me an empty string.

SystemInfo info = new SystemInfoImpl();

Is there any way to get the base URL that was set in the General Configuration of a Bamboo installation?

You can use com.atlassian.sal.api.ApplicationProperties#getBaseUrl, if you are using the Shared Access Layer (SAL) dependency (in which case it would work in Bamboo as well as Confluence, not sure which one is the typo in the question :wink:

Could you be more specific about how to use it? Maybe you can share some code?