mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged DEV\EXTENSIONS to HEAD
svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/DEV/EXTENSIONS@4865 svn://svn.alfresco.com:3691/alfresco/BRANCHES/DEV/EXTENSIONS@4866 . svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/DEV/EXTENSIONS@4872 svn://svn.alfresco.com:3691/alfresco/BRANCHES/DEV/EXTENSIONS@4884 . Dave and Gavin's search work git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4899 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -89,6 +89,16 @@ public class APIRequest extends HttpServletRequestWrapper
|
||||
{
|
||||
return getPath() + getServletPath();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the full request URL
|
||||
*
|
||||
* @return request url e.g. http://localhost:port/alfresco/service/text?searchTerms=dsfsdf
|
||||
*/
|
||||
public String getUrl()
|
||||
{
|
||||
return getScheme() + "://" + getServerName() + ":" + getServerPort() + getPathInfo() + (getQueryString() != null ? "?" + getQueryString() : "");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the currently authenticated username
|
||||
@@ -120,5 +130,25 @@ public class APIRequest extends HttpServletRequestWrapper
|
||||
String format = getParameter("format");
|
||||
return (format == null || format.length() == 0) ? "" : format;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get User Agent
|
||||
*
|
||||
* TODO: Expand on known agents
|
||||
*
|
||||
* @return MSIE / Firefox
|
||||
*/
|
||||
public String getAgent()
|
||||
{
|
||||
String userAgent = getHeader("user-agent");
|
||||
if (userAgent.indexOf("Firefox/") != -1)
|
||||
{
|
||||
return "Firefox";
|
||||
}
|
||||
else if (userAgent.indexOf("MSIE") != -1)
|
||||
{
|
||||
return "MSIE";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user