Commits

Sebastian Sdorra committed 2214f86

use ServletContainerDetector instead of SystemUtil

Comments (0)

Files changed (1)

scm-webapp/src/main/java/sonia/scm/api/rest/resources/SupportResource.java

 import org.codehaus.enunciate.modules.jersey.ExternallyManagedLifecycle;
 
 import sonia.scm.SCMContextProvider;
+import sonia.scm.ServletContainerDetector;
 import sonia.scm.Type;
 import sonia.scm.config.ScmConfiguration;
 import sonia.scm.plugin.PluginManager;
 import java.util.Map;
 import java.util.TimeZone;
 
+import javax.servlet.http.HttpServletRequest;
+
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
    * @param pluginManager
    * @param storeFactory
    * @param repositoryManager
+   * @param request
    */
   @Inject
   public SupportResource(SCMContextProvider context,
     ScmConfiguration configuration, PluginManager pluginManager,
-    StoreFactory storeFactory, RepositoryManager repositoryManager)
+    StoreFactory storeFactory, RepositoryManager repositoryManager,
+    HttpServletRequest request)
   {
     this.context = context;
     this.configuration = configuration;
     this.pluginManager = pluginManager;
     this.storeFactoryClass = storeFactory.getClass();
     this.repositoryManager = repositoryManager;
+    this.request = request;
   }
 
   //~--- get methods ----------------------------------------------------------
     env.put("configuration", configuration);
     env.put("pluginManager", pluginManager);
     env.put("runtime", new RuntimeInformation());
-    env.put("system", new SystemInformation());
+    env.put("system", new SystemInformation(request));
     env.put("repositoryHandlers", getRepositoryHandlers());
 
     return new Viewable(TEMPLATE, env);
     /**
      * Constructs ...
      *
+     *
+     * @param request
      */
-    public SystemInformation()
+    public SystemInformation(HttpServletRequest request)
     {
       os = SystemUtil.getOS();
       arch = SystemUtil.getArch();
-      container = SystemUtil.getServletContainer().name();
+      container = ServletContainerDetector.detect(request).name();
       java = System.getProperty("java.vendor").concat("/").concat(
         System.getProperty("java.version"));
       locale = Locale.getDefault().toString();
   private RepositoryManager repositoryManager;
 
   /** Field description */
+  private HttpServletRequest request;
+
+  /** Field description */
   private Class<?> storeFactoryClass;
 }