MCPcopy Create free account
hub / github.com/apache/tomcat / init

Method init

java/org/apache/catalina/filters/ExpiresFilter.java:1434–1461  ·  view source on GitHub ↗
(FilterConfig filterConfig)

Source from the content-addressed store, hash-verified

1432 }
1433
1434 @Override
1435 public void init(FilterConfig filterConfig) throws ServletException {
1436 for (Enumeration<String> names = filterConfig.getInitParameterNames(); names.hasMoreElements();) {
1437 String name = names.nextElement();
1438 String value = filterConfig.getInitParameter(name);
1439
1440 try {
1441 if (name.startsWith(PARAMETER_EXPIRES_BY_TYPE)) {
1442 String contentType =
1443 name.substring(PARAMETER_EXPIRES_BY_TYPE.length()).trim().toLowerCase(Locale.ENGLISH);
1444 ExpiresConfiguration expiresConfiguration = parseExpiresConfiguration(value);
1445 this.expiresConfigurationByContentType.put(contentType, expiresConfiguration);
1446 } else if (name.equalsIgnoreCase(PARAMETER_EXPIRES_DEFAULT)) {
1447 this.defaultExpiresConfiguration = parseExpiresConfiguration(value);
1448 } else if (name.equalsIgnoreCase(PARAMETER_EXPIRES_EXCLUDED_RESPONSE_STATUS_CODES)) {
1449 this.excludedResponseStatusCodes = commaDelimitedListToIntArray(value);
1450 } else {
1451 log.warn(sm.getString("expiresFilter.unknownParameterIgnored", name, value));
1452 }
1453 } catch (RuntimeException e) {
1454 throw new ServletException(sm.getString("expiresFilter.exceptionProcessingParameter", name, value), e);
1455 }
1456 }
1457
1458 if (log.isTraceEnabled()) {
1459 log.trace(sm.getString("expiresFilter.filterInitialized", this.toString()));
1460 }
1461 }
1462
1463 /**
1464 * <p>

Callers

nothing calls this directly

Calls 15

toStringMethod · 0.95
lengthMethod · 0.80
getInitParameterNamesMethod · 0.65
getInitParameterMethod · 0.65
putMethod · 0.65
warnMethod · 0.65
getStringMethod · 0.65
isTraceEnabledMethod · 0.65
traceMethod · 0.65
hasMoreElementsMethod · 0.45

Tested by

no test coverage detected