|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.cargo.module.webapp.WebXmlUtils
public final class WebXmlUtils
Method Summary | |
---|---|
static void |
addContextParam(WebXml webXml,
java.lang.String name,
java.lang.String value)
Adds a new context-param element to the descriptor. |
static void |
addEjbRef(WebXml webXml,
EjbRef ref)
Add an EJB Reference. |
static void |
addFilter(WebXml webXml,
Filter filter)
|
static void |
addFilter(WebXml webXml,
java.lang.String filterName,
java.lang.String filterClass)
Add a filter to the descriptor. |
static void |
addFilterInitParam(WebXml webXml,
java.lang.String name,
java.lang.String paramName,
java.lang.String paramValue)
Add an init param to a filter. |
static void |
addFilterMapping(WebXml webXml,
FilterMapping rhs)
|
static void |
addJspFile(WebXml webXml,
java.lang.String theServletName,
java.lang.String theJspFile)
Add a JSP file. |
static void |
addSecurityConstraint(WebXml webXml,
java.lang.String theWebResourceName,
java.lang.String theUrlPattern,
java.util.List theRoles)
Add a security constraint. |
static void |
addSecurityRole(WebXml webXml,
java.lang.String theRoleName)
|
static void |
addServlet(WebXml webXml,
Servlet element)
Add a servlet to the web xml. |
static void |
addServlet(WebXml webXml,
java.lang.String servletName,
java.lang.String servletClass)
Add a servlet to the descriptor. |
static void |
addServletInitParam(WebXml webXml,
java.lang.String theServletName,
java.lang.String name,
java.lang.String value)
Add an init param to a servlet. |
static void |
addServletMapping(WebXml webXml,
java.lang.String theServletName,
java.lang.String theUrlPattern)
|
static void |
addServletRunAsRoleName(WebXml webXml,
java.lang.String theServletName,
java.lang.String theRoleName)
|
static void |
addTagInitParam(WebXmlElement itemElement,
java.lang.String name,
java.lang.String value)
Add an init-param to the web xml. |
static org.jdom.Element |
getContextParam(WebXml webXml,
java.lang.String paramName)
Returns the element that contains the definition of a specific context param, or null if a context param of the specified name is not defined in the
descriptor. |
static Filter |
getFilter(WebXml theWebXml,
java.lang.String filterName)
|
static java.lang.String |
getFilterInitParam(WebXml theWebXml,
java.lang.String filterName,
java.lang.String paramName)
|
static java.util.Iterator |
getFilterInitParamNames(WebXml webXml,
java.lang.String name)
Get the init parameter names for a filter. |
static java.util.Iterator |
getFilterMappingElements(WebXml webXml,
java.lang.String theFilterName)
Returns the filter mappings that the specified filter is mapped to in an ordered list. |
static java.util.Iterator |
getFilterMappings(WebXml webXml,
java.lang.String theFilterName)
Returns the URL-patterns that the specified filter is mapped to in an ordered list. |
static java.util.Iterator |
getFilterNames(WebXml webXml)
|
static java.util.Iterator |
getFilterNamesForClass(WebXml webXml,
java.lang.String className)
Returns a list of names of filters that are mapped to the specified class. |
static java.lang.String |
getLoginConfigAuthMethod(WebXml webXml)
Get the login config authorization method. |
static SecurityConstraint |
getSecurityConstraint(WebXml webXml,
java.lang.String theUrlPattern)
Get a security constraint by URL. |
static org.jdom.Element |
getSecurityRole(WebXml webXml,
java.lang.String theRoleName)
Get the security role by name. |
static java.util.Iterator |
getSecurityRoleNames(WebXml webXml)
Get the security role names. |
static Servlet |
getServlet(WebXml theWebXml,
java.lang.String servletName)
|
static java.lang.String |
getServletInitParam(WebXml theWebXml,
java.lang.String servletName,
java.lang.String paramName)
|
static java.util.Iterator |
getServletInitParamNames(WebXml webXml,
java.lang.String theServletName)
Get the names of all the servlet init parameters. |
static java.util.Iterator |
getServletMappings(WebXml webXml,
java.lang.String theServletName)
Get the servlet mappings to the named servlet. |
static java.util.Iterator |
getServletNames(WebXml webXml)
Get an iterator of the servlet names in the web xml. |
static java.util.Iterator |
getServletNamesForClass(WebXml webXml,
java.lang.String className)
Get the names that this servlet uses. |
static java.util.Iterator |
getServletNamesForJspFile(WebXml webXml,
java.lang.String theJspFile)
Returns a list of names of servlets that are mapped to the specified JSP file. |
static java.lang.String |
getServletRunAsRoleName(WebXml webXml,
java.lang.String theServletName)
For a named servlet, return the run-as role name. |
static boolean |
hasContextParam(WebXml webXml,
java.lang.String theParamName)
Returns whether a context param by the specified name is defined in the deployment descriptor. |
static boolean |
hasFilter(WebXml webXml,
java.lang.String theFilterName)
Returns whether a servlet filter by the specified name is defined in the deployment descriptor. |
static boolean |
hasLoginConfig(WebXml webXml)
Does the descriptor have a login config? |
static boolean |
hasSecurityConstraint(WebXml webXml,
java.lang.String theUrlPattern)
Does the descriptor have a security constraint for a URL? |
static boolean |
hasSecurityRole(WebXml webXml,
java.lang.String theRoleName)
Does the role have a security definition? |
static boolean |
hasServlet(WebXml webXml,
java.lang.String servletName)
Does the web xml have a named servlet. |
static void |
setLoginConfig(WebXml webXml,
java.lang.String theAuthMethod,
java.lang.String theRealmName)
Set the login config. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.util.Iterator getFilterNamesForClass(WebXml webXml, java.lang.String className)
webXml
- The webXml file to useclassName
- The fully qualified name of the filter class
public static java.util.Iterator getFilterMappings(WebXml webXml, java.lang.String theFilterName)
webXml
- The webXml file to usetheFilterName
- The name of the servlet filter of which the mappings should be retrieved
public static java.util.Iterator getFilterMappingElements(WebXml webXml, java.lang.String theFilterName)
webXml
- The webXml file to usetheFilterName
- The name of the servlet filter of which the mappings should be retrieved
public static boolean hasContextParam(WebXml webXml, java.lang.String theParamName)
webXml
- The webXml file to usetheParamName
- The name of the context param
true
if the context param is defined, false
otherwisepublic static org.jdom.Element getContextParam(WebXml webXml, java.lang.String paramName)
null
if a context param of the specified name is not defined in the
descriptor.
webXml
- The webXml file to useparamName
- The context param name
public static boolean hasFilter(WebXml webXml, java.lang.String theFilterName)
webXml
- The webXml file to usetheFilterName
- The name of the filter
true
if the filter is defined, false
otherwisepublic static java.lang.String getServletRunAsRoleName(WebXml webXml, java.lang.String theServletName)
webXml
- The webXml file to usetheServletName
- the name of the servlet
public static void addTagInitParam(WebXmlElement itemElement, java.lang.String name, java.lang.String value)
itemElement
- The the parent element to add toname
- The name of the paramvalue
- The value for the parampublic static java.util.Iterator getFilterInitParamNames(WebXml webXml, java.lang.String name)
webXml
- The webXml file to usename
- The name of the filter to use
public static void addFilterInitParam(WebXml webXml, java.lang.String name, java.lang.String paramName, java.lang.String paramValue)
webXml
- The webXml file to usename
- The name of the filterparamName
- The name of the parameterparamValue
- The value of the parameterpublic static boolean hasServlet(WebXml webXml, java.lang.String servletName)
webXml
- The webXml file to useservletName
- The name of the servlet
true
if it does, false
if not.public static void addServlet(WebXml webXml, java.lang.String servletName, java.lang.String servletClass)
webXml
- The webXml file to useservletName
- The servlet nameservletClass
- The servlet class namepublic static java.util.Iterator getServletNamesForClass(WebXml webXml, java.lang.String className)
webXml
- The webXml file to useclassName
- the name of the class
public static java.util.Iterator getServletNamesForJspFile(WebXml webXml, java.lang.String theJspFile)
webXml
- The webXml file to usetheJspFile
- The path to the JSP file, relative to the root of the web-application
public static java.util.Iterator getServletNames(WebXml webXml)
webXml
- The webXml file to use
public static java.util.Iterator getServletMappings(WebXml webXml, java.lang.String theServletName)
webXml
- The webXml file to usetheServletName
- The name of the servlet
public static void addServlet(WebXml webXml, Servlet element)
webXml
- The webXml file to useelement
- The servlet elementpublic static void addServletInitParam(WebXml webXml, java.lang.String theServletName, java.lang.String name, java.lang.String value)
webXml
- The webXml file to usetheServletName
- The name of the servletname
- The name of the init paramvalue
- The value for the init parampublic static java.util.Iterator getServletInitParamNames(WebXml webXml, java.lang.String theServletName)
webXml
- The webXml file to usetheServletName
- The name of the servlet
public static void addSecurityConstraint(WebXml webXml, java.lang.String theWebResourceName, java.lang.String theUrlPattern, java.util.List theRoles)
webXml
- The webXml file to usetheWebResourceName
- The name of the web resourcetheUrlPattern
- The URL PatterntheRoles
- the Roles to Allow
InvocationTargetException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.NoSuchMethodException
java.lang.IllegalArgumentException
java.lang.SecurityException
public static void addJspFile(WebXml webXml, java.lang.String theServletName, java.lang.String theJspFile)
webXml
- The webXml file to usetheServletName
- The name of the servlettheJspFile
- The name of the JSP file
InvocationTargetException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.NoSuchMethodException
java.lang.IllegalArgumentException
java.lang.SecurityException
public static boolean hasSecurityConstraint(WebXml webXml, java.lang.String theUrlPattern)
webXml
- The webXml file to usetheUrlPattern
- The URL pattern to query
public static boolean hasLoginConfig(WebXml webXml)
webXml
- The webXml file to use
public static void setLoginConfig(WebXml webXml, java.lang.String theAuthMethod, java.lang.String theRealmName)
webXml
- The webXml file to usetheAuthMethod
- The authorization methodtheRealmName
- The realm namepublic static java.lang.String getLoginConfigAuthMethod(WebXml webXml)
webXml
- The webXml file to use
public static SecurityConstraint getSecurityConstraint(WebXml webXml, java.lang.String theUrlPattern)
webXml
- The webXml file to usetheUrlPattern
- The URL Pattern
public static boolean hasSecurityRole(WebXml webXml, java.lang.String theRoleName)
webXml
- The webXml file to usetheRoleName
- The name of the role
public static java.util.Iterator getSecurityRoleNames(WebXml webXml)
webXml
- The webXml file to use
public static org.jdom.Element getSecurityRole(WebXml webXml, java.lang.String theRoleName)
webXml
- The webXml file to usetheRoleName
- The name of the role
public static void addEjbRef(WebXml webXml, EjbRef ref)
webXml
- The webXml file to useref
- the EJB Reference element to addpublic static void addSecurityRole(WebXml webXml, java.lang.String theRoleName)
webXml
- The webXml file to usetheRoleName
- The role name to usepublic static Servlet getServlet(WebXml theWebXml, java.lang.String servletName)
theWebXml
- The webXml file to useservletName
- The name of the servlet to get
public static java.util.Iterator getFilterNames(WebXml webXml)
webXml
- The webXml file to use
public static Filter getFilter(WebXml theWebXml, java.lang.String filterName)
theWebXml
- The webXml file to usefilterName
- The name of the filter
public static void addFilterMapping(WebXml webXml, FilterMapping rhs)
webXml
- The webXml file to userhs
- The mapping to addpublic static java.lang.String getServletInitParam(WebXml theWebXml, java.lang.String servletName, java.lang.String paramName)
theWebXml
- The webXml file to useservletName
- The servlet nameparamName
- The parameter Name
public static void addServletRunAsRoleName(WebXml webXml, java.lang.String theServletName, java.lang.String theRoleName)
webXml
- The webXml file to usetheServletName
- The name of the servlettheRoleName
- The role name to addpublic static void addServletMapping(WebXml webXml, java.lang.String theServletName, java.lang.String theUrlPattern)
webXml
- The webXml file to usetheServletName
- The name of the servlettheUrlPattern
- the URL PAttern to addpublic static java.lang.String getFilterInitParam(WebXml theWebXml, java.lang.String filterName, java.lang.String paramName)
theWebXml
- The webXml file to usefilterName
- The name of the filterparamName
- The name of the parameter
public static void addFilter(WebXml webXml, Filter filter)
webXml
- The webXml file to usefilter
- The filter to addpublic static void addFilter(WebXml webXml, java.lang.String filterName, java.lang.String filterClass)
webXml
- The webXml file to usefilterName
- The servlet namefilterClass
- The servlet class namepublic static void addContextParam(WebXml webXml, java.lang.String name, java.lang.String value)
webXml
- The webXml containing the descriptorname
- The context namevalue
- The context value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |