public class ConfigurableUWSServlet
extends javax.servlet.http.HttpServlet
HTTP servlet fully configured with a UWS configuration file.
This configuration file may be specified in the initial parameter named
UWSConfiguration.UWS_CONF_PARAMETER
of this servlet inside the
WEB-INF/web.xml file. If none is specified, the file
UWSConfiguration.DEFAULT_UWS_CONF_FILE
will be searched inside the
directories of the classpath, and inside WEB-INF and META-INF.
Constructor and Description |
---|
ConfigurableUWSServlet() |
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
protected java.io.File |
getFile(java.lang.String filePath,
java.lang.String webAppRootPath,
java.lang.String propertyName)
Resolve the given file name/path.
|
void |
init(javax.servlet.ServletConfig config) |
protected java.io.InputStream |
searchFile(java.lang.String filePath,
javax.servlet.ServletConfig config)
Search the given file name/path in the directories of the classpath, then inside WEB-INF and finally inside META-INF.
|
protected void |
service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
init
in interface javax.servlet.Servlet
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
protected final java.io.InputStream searchFile(java.lang.String filePath, javax.servlet.ServletConfig config)
filePath
- A file name/path.config
- Servlet configuration (containing also the context class loader - link with the servlet classpath).protected final java.io.File getFile(java.lang.String filePath, java.lang.String webAppRootPath, java.lang.String propertyName) throws UWSException
Resolve the given file name/path.
Only the URI protocol "file:" is allowed. If the protocol is different a UWSException
is thrown.
If not an absolute URI, the given path may be either relative or absolute. A relative path is always considered as relative from the Web Application directory (supposed to be given in 2nd parameter).
filePath
- URI/Path/Name of the file to get.webAppRootPath
- Web Application directory local path.propertyName
- Name of the property which gives the given file path.UWSException
- If the given URI is malformed or if the used URI scheme is different from "file:".public void destroy()
destroy
in interface javax.servlet.Servlet
destroy
in class javax.servlet.GenericServlet
protected void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
service
in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
java.io.IOException