ObjectData bindingParent = getBinding().getNavigationService().getFolderParent(getRepositoryId(), objectId,
getPropertyQueryName(PropertyIds.OBJECT_ID), null);
if (bindingParent.getProperties() == null) {
// should not happen...
throw new CmisRuntimeException("Repository sent invalid data!");
}
// get id property
PropertyData<?> idProperty = bindingParent.getProperties().getProperties().get(PropertyIds.OBJECT_ID);
if (!(idProperty instanceof PropertyId)) {
// the repository sent an object without a valid object id...
throw new CmisRuntimeException("Repository sent invalid data! No object id!");
}
// fetch the object and make sure it is a folder
CmisObject parentFolder = getSession().getObject((String) idProperty.getFirstValue(), context);
if (!(parentFolder instanceof Folder)) {
// the repository sent an object that is not a folder...
throw new CmisRuntimeException("Repository sent invalid data! Object is not a folder!");
}
return Collections.singletonList((Folder) parentFolder);
}