Class WebScriptRequestURLImpl
- java.lang.Object
-
- org.springframework.extensions.webscripts.WebScriptRequestImpl
-
- org.springframework.extensions.webscripts.WebScriptRequestURLImpl
-
- All Implemented Interfaces:
WebScriptRequest
public abstract class WebScriptRequestURLImpl extends WebScriptRequestImpl
Web Script Request implementation that acts upon a string representation of a URL- Author:
- davidc
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringcontextPathScript Url componentsprotected java.lang.StringpathInfoprotected java.util.Map<java.lang.String,java.lang.String>queryArgsprotected java.util.Map<java.lang.String,java.util.List<java.lang.String>>queryArgsMultiprotected java.lang.StringqueryStringprotected MatchserviceMatchService bound to this requestprotected java.lang.StringservletPath-
Fields inherited from class org.springframework.extensions.webscripts.WebScriptRequestImpl
logger, MULTIPART_FORM_DATA
-
-
Constructor Summary
Constructors Constructor Description WebScriptRequestURLImpl(Runtime runtime, java.lang.String[] scriptUrlParts, Match serviceMatch)ConstructWebScriptRequestURLImpl(Runtime runtime, java.lang.String scriptUrl, Match serviceMatch)Construct Note: It's assumed scriptUrl contains context path
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetContextPath()Gets the Alfresco Context Pathjava.lang.StringgetParameter(java.lang.String name)Gets the value of the named parameterjava.lang.String[]getParameterNames()Gets the names of all parameters on the Urljava.lang.String[]getParameterValues(java.lang.String name)Gets the (array) value of the named parameter Note: An array of one item is returned when a "single value" named parameter is requestedjava.lang.StringgetPathInfo()Gets the service specific pathjava.lang.StringgetQueryString()Gets the query Stringjava.lang.StringgetServiceContextPath()Gets the Alfresco Web Script Context PathMatchgetServiceMatch()Gets the matching API Service for this requestjava.lang.StringgetServicePath()Gets the Alfresco Service Pathjava.lang.StringgetURL()Gets the full request URLstatic java.lang.String[]splitURL(java.lang.String scriptUrl)Splits a Web Script Url into its component partsstatic java.lang.String[]splitURL(java.lang.String context, java.lang.String scriptUrl)Splits a Web Script Url into its component partsjava.lang.StringtoString()-
Methods inherited from class org.springframework.extensions.webscripts.WebScriptRequestImpl
forceSuccessStatus, getContentType, getExtensionPath, getFormat, getFormatStyle, getJSONCallback, getRuntime, isGuest, parseContent
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.springframework.extensions.webscripts.WebScriptRequest
getAgent, getContent, getHeader, getHeaderNames, getHeaderValues, getServerPath
-
-
-
-
Field Detail
-
contextPath
protected java.lang.String contextPath
Script Url components
-
servletPath
protected java.lang.String servletPath
-
pathInfo
protected java.lang.String pathInfo
-
queryString
protected java.lang.String queryString
-
queryArgs
protected java.util.Map<java.lang.String,java.lang.String> queryArgs
-
queryArgsMulti
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> queryArgsMulti
-
serviceMatch
protected Match serviceMatch
Service bound to this request
-
-
Method Detail
-
splitURL
public static java.lang.String[] splitURL(java.lang.String scriptUrl)
Splits a Web Script Url into its component parts- Parameters:
scriptUrl- url e.g. /alfresco/service/mytasks?f=1- Returns:
- url parts [0] = context (e.g. alfresco), [1] = servlet (e.g. service), [2] = script (e.g. mytasks), [3] = args (e.g. f=1)
-
splitURL
public static java.lang.String[] splitURL(java.lang.String context, java.lang.String scriptUrl)Splits a Web Script Url into its component parts- Parameters:
context- context path (can be empty string but never null)scriptUrl- url e.g. /alfresco/service/mytasks?f=1- Returns:
- url parts [0] = context (e.g. alfresco, or empty if no context), [1] = servlet (e.g. service), [2] = script (e.g. mytasks), [3] = args (e.g. f=1)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getServiceMatch
public Match getServiceMatch()
Description copied from interface:WebScriptRequestGets the matching API Service for this request- Returns:
- the service match
-
getContextPath
public java.lang.String getContextPath()
Description copied from interface:WebScriptRequestGets the Alfresco Context Path- Returns:
- context url e.g. /alfresco
-
getServiceContextPath
public java.lang.String getServiceContextPath()
Description copied from interface:WebScriptRequestGets the Alfresco Web Script Context Path- Returns:
- service url e.g. /alfresco/service
-
getServicePath
public java.lang.String getServicePath()
Description copied from interface:WebScriptRequestGets the Alfresco Service Path- Returns:
- service url e.g. /alfresco/service/search/keyword
-
getURL
public java.lang.String getURL()
Description copied from interface:WebScriptRequestGets the full request URL- Returns:
- request url e.g. /alfresco/service/search/keyword?q=term
-
getPathInfo
public java.lang.String getPathInfo()
Description copied from interface:WebScriptRequestGets the service specific path- Returns:
- request path e.g. /search/keyword
-
getQueryString
public java.lang.String getQueryString()
Description copied from interface:WebScriptRequestGets the query String- Returns:
- query string e.g. q=alfresco&format=atom
-
getParameterNames
public java.lang.String[] getParameterNames()
Description copied from interface:WebScriptRequestGets the names of all parameters on the Url- Returns:
- the names (empty, if none)
-
getParameter
public java.lang.String getParameter(java.lang.String name)
Description copied from interface:WebScriptRequestGets the value of the named parameter- Parameters:
name- parameter name- Returns:
- parameter value (or null, if parameter does not exist)
-
getParameterValues
public java.lang.String[] getParameterValues(java.lang.String name)
Description copied from interface:WebScriptRequestGets the (array) value of the named parameter Note: An array of one item is returned when a "single value" named parameter is requested- Parameters:
name- parameter name- Returns:
- array of values (or null, if parameter does not exist)
-
-