Hi Nicu,

Are you taking about the client or the server side?

Here is an answer for the client side.
getObject returns a CmisObject. Use instanceof to determine if it is a Document object or a Folder object and then cast to Document or Folder.


Here is a generic way to retrieve the path:

String path = null;
CmisObject obj = session.getObject("1234567890");

if(obj instanceof FileableCmisObject) {
  FileableCmisObject fobj = (FileableCmisObject) obj;
  List<String> paths = fobj.getPaths();
  if(!paths.isEmpty()) {
    path = paths.get(0);
  }
}


- Florian


Hi,

Java, Apache Chemistry 0.12.0, with OpenCmis-Fileshare- 0.12.0
Thanks,

Nicu Marasoiu

-----Original Message-----
From: Till Lorentzen [mailto:till.lorent...@graudata.com]
Sent: Wednesday, October 08, 2014 6:25 PM
To: dev@chemistry.apache.org
Subject: Re: how to get the path of a created folder, or for an objectId?

Hi Nicu,

it would be very helpful if you would provide a little bit more
informations. What kind of client library do you use? Java? Python?
PHP?
.Net? Objective-C?

And the version would also be helpful to answer your question(s).

Best regards

Till

On 10/08/2014 05:16 PM, Nicolae Marasoiu wrote:
Hi,

I need a way to determine the path of an objectId when it is a file or a folder. Do you know any? I do not know why getObjectById returns an implementation of just ObjectId and not Fileable or Folder, when applicable. I have a recursive function to create folders, and I would need to debug the paths of the folders. But in order to be efficient I use object ids rather than string paths (I also do not use caching).
Please advise,

Thanks,
Nicu

Reply via email to