MCPcopy Index your code
hub / github.com/apache/tomcat / init

Method init

java/org/apache/catalina/servlets/WebdavServlet.java:296–359  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

294
295
296 @Override
297 public void init() throws ServletException {
298
299 super.init();
300
301 // Validate that the Servlet is only mapped to wildcard mappings
302 String servletName = getServletConfig().getServletName();
303 ServletRegistration servletRegistration =
304 getServletConfig().getServletContext().getServletRegistration(servletName);
305 Collection<String> servletMappings = servletRegistration.getMappings();
306 for (String mapping : servletMappings) {
307 if (!mapping.endsWith("/*")) {
308 log(sm.getString("webdavservlet.nonWildcardMapping", mapping));
309 }
310 }
311
312 if (getServletConfig().getInitParameter("maxDepth") != null) {
313 maxDepth = Integer.parseInt(getServletConfig().getInitParameter("maxDepth"));
314 }
315
316 if (getServletConfig().getInitParameter("maxRequestBodySize") != null) {
317 maxRequestBodySize = Integer.parseInt(getServletConfig().getInitParameter("maxRequestBodySize"));
318 }
319
320 if (getServletConfig().getInitParameter("allowSpecialPaths") != null) {
321 allowSpecialPaths = Boolean.parseBoolean(getServletConfig().getInitParameter("allowSpecialPaths"));
322 }
323
324 if (getServletConfig().getInitParameter("strictIfProcessing") != null) {
325 strictIfProcessing = Boolean.parseBoolean(getServletConfig().getInitParameter("strictIfProcessing"));
326 }
327
328 if (getServletConfig().getInitParameter("serveSubpathOnly") != null) {
329 serveSubpathOnly = Boolean.parseBoolean(getServletConfig().getInitParameter("serveSubpathOnly"));
330 }
331
332 String propertyStore = getServletConfig().getInitParameter("propertyStore");
333 if (propertyStore != null) {
334 try {
335 Class<?> clazz = Thread.currentThread().getContextClassLoader().loadClass(propertyStore);
336 store = (PropertyStore) clazz.getConstructor().newInstance();
337 // Set init parameters as properties on the store
338 Enumeration<String> parameterNames = getServletConfig().getInitParameterNames();
339 while (parameterNames.hasMoreElements()) {
340 String parameterName = parameterNames.nextElement();
341 if (parameterName.startsWith("store.")) {
342 StringBuilder actualMethod = new StringBuilder();
343 String parameterValue = getServletConfig().getInitParameter(parameterName);
344 parameterName = parameterName.substring("store.".length());
345 if (!IntrospectionUtils.setProperty(store, parameterName, parameterValue, true, actualMethod)) {
346 log(sm.getString("webdavservlet.noStoreParameter", parameterName, parameterValue));
347 }
348 }
349 }
350 } catch (Exception e) {
351 log(sm.getString("webdavservlet.storeError", propertyStore), e);
352 }
353 }

Callers

nothing calls this directly

Calls 15

getMappingsMethod · 0.95
setPropertyMethod · 0.95
endsWithMethod · 0.80
parseBooleanMethod · 0.80
lengthMethod · 0.80
initMethod · 0.65
getServletNameMethod · 0.65
getServletConfigMethod · 0.65
getServletContextMethod · 0.65
logMethod · 0.65
getStringMethod · 0.65

Tested by

no test coverage detected