mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V2.0 to HEAD
svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V2.0@5118 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V2.0@5119 . - OpenSearch Proxy svn merge svn://svn.alfresco.com:3691/alfresco/BRANCHES/V2.0@5121 svn://svn.alfresco.com:3691/alfresco/BRANCHES/V2.0@5122 . - Extract sample OpenSearch engine registrations into extension config file. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5125 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -91,6 +91,29 @@ public class APIRequest extends HttpServletRequestWrapper
|
||||
return getPath() + getServletPath();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the path extension beyond the path registered for this service
|
||||
*
|
||||
* e.g.
|
||||
* a) service registered path = /search/engine
|
||||
* b) request path = /search/engine/external
|
||||
*
|
||||
* => /external
|
||||
*
|
||||
* @return extension path
|
||||
*/
|
||||
public String getExtensionPath(APIService service)
|
||||
{
|
||||
String servicePath = service.getHttpUri();
|
||||
String extensionPath = getPathInfo();
|
||||
int extIdx = extensionPath.indexOf(servicePath);
|
||||
if (extIdx != -1)
|
||||
{
|
||||
extensionPath = extensionPath.substring(extIdx + servicePath.length() + 1 /* exclude leading / */);
|
||||
}
|
||||
return extensionPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the full request URL
|
||||
*
|
||||
|
Reference in New Issue
Block a user