mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged BRANCHES/DEV/THOR1_SPRINTS to HEAD:
36882: THOR-1424: WebDAV via HTML/browser view: "Up a level" link does not work if at the network level git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@36883 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -430,8 +430,8 @@ public class GetMethod extends WebDAVMethod
|
||||
writer.write("<td colspan='4' class='textData'><a href=\"");
|
||||
|
||||
// Strip the last folder from the path
|
||||
String[] paths = getDAVHelper().splitPath(rootURL.substring(0, rootURL.length() - 1));
|
||||
writer.write(paths[0]);
|
||||
String parentFolderUrl = parentFolder(rootURL);
|
||||
writer.write(parentFolderUrl);
|
||||
|
||||
writer.write("\">");
|
||||
writer.write("[");
|
||||
@@ -553,6 +553,29 @@ public class GetMethod extends WebDAVMethod
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a path, will return the parent path. For example: /a/b/c
|
||||
* will return /a/b and /a/b will return /a.
|
||||
*
|
||||
* @param path The path to return the parent of - must be non-null.
|
||||
* @return String - parent path.
|
||||
*/
|
||||
private String parentFolder(String path)
|
||||
{
|
||||
if (path.endsWith(WebDAVHelper.PathSeperator))
|
||||
{
|
||||
// Strip trailing slash.
|
||||
path = path.substring(0, path.length() - 1);
|
||||
}
|
||||
String[] paths = getDAVHelper().splitPath(path);
|
||||
String parent = paths[0];
|
||||
if (parent.equals(""))
|
||||
{
|
||||
parent = WebDAVHelper.PathSeperator;
|
||||
}
|
||||
return parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats the given size for display in a directory listing
|
||||
*
|
||||
|
Reference in New Issue
Block a user