cancel
Showing results for 
Search instead for 
Did you mean: 

Why toDisplayPath shows the parent path?

spilby
Confirmed Champ
Confirmed Champ
I want to return a friendly path from a node. I try to use this:


getNodeService().getPath(nodeRef).toDisplayPath(getNodeService(), getPermissionService())


but if nodeRef path is A/B/C, toDisplayPath returns me A/B.

What's the reason? Are there another method to obtain a full friendly path?

Thanks!
1 REPLY 1

sanket
Champ on-the-rise
Champ on-the-rise
It is because the method itself returns the PATH of the nodeRef (where the nodeRef actually lies).
So for example your file test.pdf lies in Company Home/FolderA then the method getPath() should return -> Company Home/FolderA; and not Company Home/FolderA/test.pdf

In your case, if your nodeRef lies in C folder ( A/B/C ), and still the method getPath() returns A/B, then you need to verify the nodeRef once. It might be incorrect.