• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hazendaz / sitemesh2 / 59

22 Mar 2026 02:30AM UTC coverage: 40.347%. Remained the same
59

push

github

hazendaz
[mvn] Update maven wrapper

698 of 1891 branches covered (36.91%)

Branch coverage included in aggregate %.

1555 of 3693 relevant lines covered (42.11%)

0.42 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/com/opensymphony/module/sitemesh/Config.java
1
/*
2
 * SPDX-License-Identifier: Apache-2.0
3
 * Copyright 2011-2026 Hazendaz
4
 */
5
/*
6
 * Title:        Config
7
 * Description:
8
 *
9
 * This software is published under the terms of the OpenSymphony Software
10
 * License version 1.1, of which a copy has been included with this
11
 * distribution in the LICENSE.txt file.
12
 */
13

14
package com.opensymphony.module.sitemesh;
15

16
import jakarta.servlet.FilterConfig;
17
import jakarta.servlet.ServletConfig;
18
import jakarta.servlet.ServletContext;
19

20
/**
21
 * Common interface to ServletConfig and FilterConfig (since jakarta.servlet.Config was removed from 2.3 spec).
22
 *
23
 * @author <a href="mailto:joe@truemesh.com">Joe Walnes</a>
24
 */
25
public class Config {
26

27
    /** The servlet config. */
28
    private ServletConfig servletConfig;
29

30
    /** The filter config. */
31
    private FilterConfig filterConfig;
32

33
    /** The config file. */
34
    private String configFile;
35

36
    /**
37
     * Instantiates a new config.
38
     *
39
     * @param servletConfig
40
     *            the servlet config
41
     */
42
    public Config(ServletConfig servletConfig) {
×
43
        if (servletConfig == null) {
×
44
            throw new NullPointerException("ServletConfig cannot be null");
×
45
        }
46
        this.servletConfig = servletConfig;
×
47
        this.configFile = servletConfig.getInitParameter("configFile");
×
48
    }
×
49

50
    /**
51
     * Instantiates a new config.
52
     *
53
     * @param filterConfig
54
     *            the filter config
55
     */
56
    public Config(FilterConfig filterConfig) {
×
57
        if (filterConfig == null) {
×
58
            throw new NullPointerException("FilterConfig cannot be null");
×
59
        }
60
        this.filterConfig = filterConfig;
×
61
        this.configFile = filterConfig.getInitParameter("configFile");
×
62
    }
×
63

64
    /**
65
     * Gets the servlet context.
66
     *
67
     * @return the servlet context
68
     */
69
    public ServletContext getServletContext() {
70
        return servletConfig != null ? servletConfig.getServletContext() : filterConfig.getServletContext();
×
71
    }
72

73
    /**
74
     * Gets the config file.
75
     *
76
     * @return the config file
77
     */
78
    public String getConfigFile() {
79
        return configFile;
×
80
    }
81
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc