WebDAV/SPP: remove static WebDAV.getURLForPath(...) methods.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@39178 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Matt Ward
2012-07-12 10:22:19 +00:00
parent 6370b1b66d
commit 938dc095fd
2 changed files with 32 additions and 59 deletions

View File

@@ -284,9 +284,39 @@ public class WebDAVHelper
return results;
}
protected String getURLForPath(HttpServletRequest request, String path, boolean isFolder, String userAgent)
public String getURLForPath(HttpServletRequest request, String path, boolean isCollection)
{
return WebDAV.getURLForPath(request, getUrlPathPrefix(request), path, isFolder, userAgent);
return getURLForPath(request, path, isCollection, null);
}
public String getURLForPath(HttpServletRequest request, String path, boolean isCollection, String userAgent)
{
String urlPathPrefix = getUrlPathPrefix(request);
StringBuilder urlStr = new StringBuilder(urlPathPrefix);
if (path.equals(WebDAV.RootPath) == false)
{
// split the path and URL encode each path element
for (StringTokenizer t = new StringTokenizer(path, PathSeperator); t.hasMoreTokens(); /**/)
{
urlStr.append( WebDAVHelper.encodeURL(t.nextToken(), userAgent) );
if (t.hasMoreTokens())
{
urlStr.append(PathSeperator);
}
}
}
// If the URL is to a collection add a trailing slash
if (isCollection && urlStr.charAt( urlStr.length() - 1) != PathSeperatorChar)
{
urlStr.append( PathSeperator);
}
logger.debug("getURLForPath() path:" + path + " => url:" + urlStr);
// Return the URL string
return urlStr.toString();
}
/**