mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged 5.1.N (5.1.2) to 5.2.N (5.2.1)
129597 mmuller: Merged 5.0.N (5.0.5) to 5.1.N (5.1.2) (PARTIAL MERGE) 129593 mmuller: Merged 5.0.4 (5.0.4) to 5.0.N (5.0.5) 129585 mmuller: Merged 5.0.3 (5.0.3.9) to 5.0.4 (5.0.4) 129514 mmuller: MNT-16380, REPO-927, ESC-469 Regression fix from 4.2 --> 5.0. Can now use relative paths again. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@129608 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -428,14 +428,30 @@ public class StreamContent extends AbstractWebScript
|
||||
{
|
||||
this.ref = new NodeRef(nodeRef);
|
||||
}
|
||||
|
||||
|
||||
ObjectReference(StoreRef ref, String id)
|
||||
{
|
||||
if (id.indexOf('/') != -1)
|
||||
String[] relativePath = id.split("/");
|
||||
|
||||
// bug fix MNT-16380
|
||||
// for using a relative path to a node id eg. 18cc-.../folder1/.../folderN/fileA.txt
|
||||
// if only one slash we don't have a relative path
|
||||
if (relativePath.length <= 2)
|
||||
{
|
||||
id = id.substring(0, id.indexOf('/'));
|
||||
if (id.indexOf('/') != -1)
|
||||
{
|
||||
id = id.substring(0, id.indexOf('/'));
|
||||
}
|
||||
this.ref = new NodeRef(ref, id);
|
||||
}
|
||||
else
|
||||
{
|
||||
String[] reference = new String[relativePath.length + 2];
|
||||
reference[0] = ref.getProtocol();
|
||||
reference[1] = ref.getIdentifier();
|
||||
System.arraycopy(relativePath, 0, reference, 2, relativePath.length);
|
||||
this.ref = repository.findNodeRef("node", reference);
|
||||
}
|
||||
this.ref = new NodeRef(ref, id);
|
||||
}
|
||||
|
||||
ObjectReference(StoreRef ref, String[] path)
|
||||
|
Reference in New Issue
Block a user