How to get full folder path from noderef
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2014 11:59 AM
I like to get the full folder name where the document has just been created. My code has condition logic on how to act based on the folder name.
How do I do this in java?
Thanks a bunch!
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2014 12:10 PM
Document doc = (Document) session.getObject(object_id);doc.getPaths().get(0);
the name of the document is concatenated at the end of the path so you have to remove it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2014 02:04 PM
I have access to the NodeRef and the NodeRefService which I can use but I can't find any reference showing me how to get the Path of the document. I can get the FileInfo object for the document but this FileInfo only seems to contain the file name and whether the noderef is a file or a folder. I need the full path like /Sites/aptest/documentLibrary/DropOff/Invoice1.pdf (not just the file name which is Invoice1.pdf)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2014 09:50 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2014 02:37 AM
This may help you.
<java>
Path folderPath = nodeService.getPath("FOLDER_NODE_REF");
If you need the folder path as prefixed string,
String prefixedPath = folderPath.toPrefixString(namespaceService);
</java>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2016 05:15 PM
what if i want noderef by providing the path of file?
I have file present in alfresco repository at some path. How do i get the noderef using path.
Actually i want to download that on my project.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2016 09:16 PM
Please use following method of org.alfresco.service.cmr.model.FileFolderService,it is used to resolve a file or folder name path from a given root node down to the final node.
for rootNodeRef you can pass company root node
public FileInfo resolveNamePath(NodeRef rootNodeRef, List<String> pathElements) throws FileNotFoundException;