mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)
106172: Merged 5.0.N (5.0.3) to HEAD-BUG-FIX (5.1/Cloud) (PARTIAL MERGE) 106160: Merged DEV to 5.0.N (5.0.3) 103830 : MNT-14016 : Setting system.webdav.servlet.enabled=false throws a SEVERE exception during startup - Logging info message instead of throwing exception when webdav is disabled. - Updated service method to return 404 Not Found for disabled webdav 105880 : MNT-14016 : Setting system.webdav.servlet.enabled=false throws a SEVERE exception during startup - Added return statement to stop execution if webdav is not enabled. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@106181 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -94,6 +94,8 @@ public class WebDAVServlet extends HttpServlet
|
||||
private WebDAVHelper m_davHelper;
|
||||
private WebDAVActivityPoster activityPoster;
|
||||
|
||||
private WebDAVInitParameters initParams;
|
||||
|
||||
/**
|
||||
* @see javax.servlet.http.HttpServlet#service(javax.servlet.http.HttpServletRequest,
|
||||
* javax.servlet.http.HttpServletResponse)
|
||||
@@ -101,8 +103,14 @@ public class WebDAVServlet extends HttpServlet
|
||||
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException,
|
||||
IOException
|
||||
{
|
||||
if (!initParams.getEnabled())
|
||||
{
|
||||
response.sendError(HttpServletResponse.SC_NOT_FOUND);
|
||||
return;
|
||||
}
|
||||
|
||||
long startTime = 0;
|
||||
if (logger.isInfoEnabled())
|
||||
if (logger.isTraceEnabled())
|
||||
{
|
||||
startTime = System.currentTimeMillis();
|
||||
}
|
||||
@@ -147,9 +155,9 @@ public class WebDAVServlet extends HttpServlet
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (logger.isInfoEnabled())
|
||||
if (logger.isTraceEnabled())
|
||||
{
|
||||
logger.info(request.getMethod() + " took " + (System.currentTimeMillis()-startTime) + "ms to execute ["+request.getRequestURI()+"]");
|
||||
logger.trace(request.getMethod() + " took " + (System.currentTimeMillis()-startTime) + "ms to execute ["+request.getRequestURI()+"]");
|
||||
}
|
||||
|
||||
FileFilterMode.clearClient();
|
||||
@@ -240,12 +248,13 @@ public class WebDAVServlet extends HttpServlet
|
||||
|
||||
// Get global configuration properties
|
||||
WebApplicationContext wc = WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext());
|
||||
WebDAVInitParameters initParams = (WebDAVInitParameters) wc.getBean(BEAN_INIT_PARAMS);
|
||||
initParams = (WebDAVInitParameters) wc.getBean(BEAN_INIT_PARAMS);
|
||||
|
||||
// Render this servlet permanently unavailable if its enablement property is not set
|
||||
if (!initParams.getEnabled())
|
||||
{
|
||||
throw new UnavailableException("WebDAV not enabled.");
|
||||
logger.info("Marking servlet WebDAV as unavailable!");
|
||||
return;
|
||||
}
|
||||
|
||||
// Get root paths
|
||||
|
Reference in New Issue
Block a user