I'm downloading a content from alfresco with RESTFull calls. First I obtain the ticket and then I call the DownloadServlet alfresco/download/attach/workspace/SpacesStore/GUID/documentName.
The problem is that I don't know previously the documentName. If I put an invented name (for example, "document") the content is download with this name, but I want the real name that is stored in alfresco.
The unique way is calling before a "GET /alfresco/service/api/metadata?nodeRef=workspace://SpacesStore/GUID" service to obtain the metadata and the name property? Or there are a best option to know the name of the document to download it with this?
There is only one line code to get the document name; if you have the nodeRef of the document. String fileName = getNodeService().getProperty(nodeRef, ContentModel.PROP_NAME).toString();
Well, in this case, I don't use the Alfresco API. Only REST calls. My code is outside a webscript. Is the reason to use /alfresco/service/api/metadata. Works ok, but for a best performance, I want to know if it's the best solution to obtain the name.