cancel
Showing results for 
Search instead for 
Did you mean: 

HELP :-)

testingit
Champ in-the-making
Champ in-the-making
Hi,

Is there a way to get NODE ID by it's path , ie:
input: /PATH/TO/DIR123/FILE.DOC
output: 282af6f5-508c-11dc-800c-d5564c95a581
2 REPLIES 2

testingit
Champ in-the-making
Champ in-the-making
I can't find the solution by myself, maybe someone can look and help ?

10x!

rdanner
Champ in-the-making
Champ in-the-making
FileFolderService offers the following API

resolveNamePath [Source]

FileInfo resolveNamePath(NodeRef rootNodeRef,
                         java.util.List<java.lang.String> pathElements)
                         throws FileNotFoundException

    Resolve a file or folder name path from a given root node down to the final node.

    Parameters:
        rootNodeRef - the start of the path given, i.e. the '/' in '/A/B/C' for example
        pathElements - a list of names in the path
    Returns:
        Returns the info of the file or folder
    Throws:
        FileNotFoundException - if no file or folder exists along the path


from there you get a FileInfo from which you can obtain a NodeRef from which you can obtain a node ID