public class ResourceRetriever extends Object
java.io.InputStream
, String
or java.util.Properties
.Modifier and Type | Method | Description |
---|---|---|
static Properties |
getProperties(javax.servlet.ServletConfig servletConfig,
String paramName,
org.apache.logging.log4j.Logger logger) |
Gets the
java.util.Properties in the specified servlet
web.xml init parameter location. |
static Properties |
getProperties(javax.servlet.ServletContext servletCtx,
String paramName,
org.apache.logging.log4j.Logger logger) |
Gets the
java.util.Properties in the specified servlet
context web.xml init parameter location. |
static InputStream |
getStream(javax.servlet.ServletConfig servletConfig,
String paramName,
org.apache.logging.log4j.Logger logger) |
Gets the resource in the specified servlet
web.xml init
parameter location. |
static InputStream |
getStream(javax.servlet.ServletContext servletCtx,
String paramName,
org.apache.logging.log4j.Logger logger) |
Gets the resource in the specified servlet context
web.xml
init parameter location. |
static String |
getString(javax.servlet.ServletContext servletCtx,
String paramName,
org.apache.logging.log4j.Logger logger) |
Gets the resource in the specified servlet context
web.xml
init parameter location. |
public static InputStream getStream(javax.servlet.ServletContext servletCtx, String paramName, org.apache.logging.log4j.Logger logger) throws Exception
web.xml
init parameter location.servletCtx
- The servlet context. Must not be null
.paramName
- The name of the servlet context init parameter
specifying the resource file (relative to the web
app root). For example,
/WEB-INF/authService.properties
. Must not
be null
.logger
- To log exceptions at ERROR level, null
if
none.Exception
- On a missing servlet context parameter or a
missing resource.public static InputStream getStream(javax.servlet.ServletConfig servletConfig, String paramName, org.apache.logging.log4j.Logger logger) throws Exception
web.xml
init
parameter location.servletConfig
- The servlet configuration. Must not be
null
.paramName
- The name of the servlet init parameter
specifying the resource file (relative to the
web app root). For example,
/WEB-INF/authService.properties
. Must
not be null
.logger
- To log exceptions at ERROR level, null
if none.Exception
- On a missing servlet init parameter or a
missing resource.public static String getString(javax.servlet.ServletContext servletCtx, String paramName, org.apache.logging.log4j.Logger logger) throws Exception
web.xml
init parameter location.servletCtx
- The servlet context. Must not be null
.paramName
- The name of the servlet context init parameter
specifying the resource file (relative to the web
app root). For example,
/WEB-INF/authService.properties
. Must not
be null
.logger
- To log exceptions at ERROR level, null
if
none.Exception
- On a missing servlet context parameter or a
missing resource.public static Properties getProperties(javax.servlet.ServletContext servletCtx, String paramName, org.apache.logging.log4j.Logger logger) throws Exception
java.util.Properties
in the specified servlet
context web.xml
init parameter location.servletCtx
- The servlet context. Must not be null
.paramName
- The name of the servlet context init parameter
specifying the properties file (relative to the
web app root). For example,
/WEB-INF/authService.properties
. Must not
be null
.logger
- To log exceptions at ERROR level, null
if
none.Exception
- On a missing servlet context parameter, missing or
bad properties file.public static Properties getProperties(javax.servlet.ServletConfig servletConfig, String paramName, org.apache.logging.log4j.Logger logger) throws Exception
java.util.Properties
in the specified servlet
web.xml
init parameter location.servletConfig
- The servlet configuration. Must not be
null
.paramName
- The name of the servlet init parameter
specifying the properties file (relative to
the web app root). For example,
/WEB-INF/authService.properties
. Must
not be null
.logger
- To log exceptions at ERROR level, null
if none.Exception
- On a missing servlet context parameter, missing or
bad properties file.Copyright © 2018 Connect2id. All rights reserved.