Commit bdb97f4d authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Removed pluginsDirectory static variable due to possible misconfiguration if...

Removed pluginsDirectory static variable due to possible misconfiguration if JiveGlobal#homeDirectory was not initialized yet.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1643 b35dd754-fafc-0310-a699-88a17e54d16e
parent 1ea5638c
...@@ -55,13 +55,11 @@ import java.util.concurrent.ConcurrentHashMap; ...@@ -55,13 +55,11 @@ import java.util.concurrent.ConcurrentHashMap;
public class PluginServlet extends HttpServlet { public class PluginServlet extends HttpServlet {
private static Map<String, HttpServlet> servlets; private static Map<String, HttpServlet> servlets;
private static File pluginDirectory;
private static PluginManager pluginManager; private static PluginManager pluginManager;
private static ServletConfig servletConfig; private static ServletConfig servletConfig;
static { static {
servlets = new ConcurrentHashMap<String, HttpServlet>(); servlets = new ConcurrentHashMap<String, HttpServlet>();
pluginDirectory = new File(JiveGlobals.getHomeDirectory(), "plugins");
} }
public void init(ServletConfig config) throws ServletException { public void init(ServletConfig config) throws ServletException {
...@@ -303,6 +301,7 @@ public class PluginServlet extends HttpServlet { ...@@ -303,6 +301,7 @@ public class PluginServlet extends HttpServlet {
response.setStatus(HttpServletResponse.SC_NOT_FOUND); response.setStatus(HttpServletResponse.SC_NOT_FOUND);
return; return;
} }
File pluginDirectory = new File(JiveGlobals.getHomeDirectory(), "plugins");
File image = new File(pluginDirectory, parts[1] + File.separator + "web" + File image = new File(pluginDirectory, parts[1] + File.separator + "web" +
File.separator + "images" + File.separator + parts[3]); File.separator + "images" + File.separator + parts[3]);
if (!image.exists()) { if (!image.exists()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment