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