package com.atlassian.sal.jira;

import com.atlassian.jira.util.BuildUtils;
import com.atlassian.jira.util.velocity.VelocityRequestContextFactory;
import com.atlassian.sal.api.ApplicationProperties;

import java.util.Date;
import java.io.File;

/**
 * JIRA implementation of WebProperties
 */
public class JiraApplicationProperties implements ApplicationProperties
{
    private final VelocityRequestContextFactory velocityRequestContextFactory;

    public JiraApplicationProperties(VelocityRequestContextFactory velocityRequestContextFactory)
    {
        this.velocityRequestContextFactory = velocityRequestContextFactory;
    }

    public String getBaseUrl()
    {
        return velocityRequestContextFactory.getJiraVelocityRequestContext().getCanonicalBaseUrl();
    }

    public String getDisplayName()
    {
        return "JIRA";
    }

    public String getVersion()
    {
        return BuildUtils.getVersion();
    }

    public Date getBuildDate()
    {
        return BuildUtils.getCurrentBuildDate();
    }

    public String getBuildNumber()
    {
        return BuildUtils.getCurrentBuildNumber();
    }

    public File getHomeDirectory()
    {
        throw new UnsupportedOperationException();
    }
}

@@ -140,16 +140,64 @@
 actory;%0A
+import com.atlassian.jira.config.util.JiraHome;%0A
 import c
@@ -486,16 +486,53 @@
 Factory;
+%0A    private final JiraHome jiraHome;
 %0A%0A    pu
@@ -621,16 +621,35 @@
 tFactory
+, JiraHome jiraHome
 )%0A    %7B%0A
@@ -720,24 +720,58 @@
 extFactory;%0A
+        this.jiraHome = jiraHome;%0A
     %7D%0A%0A    p
@@ -1309,47 +1309,31 @@
     
-throw new UnsupportedOperationException
+return jiraHome.getHome
 ();%0A

Return JIRA home directory SAL-59