List<ObjectParentData> result = null;
if (sop instanceof SingleFiling) {
ObjectData parent = getFolderParentIntern(repositoryId, (SingleFiling) sop, filter, objectInfos);
if (null != parent) {
ObjectParentDataImpl parentData = new ObjectParentDataImpl();
parentData.setObject(parent);
String path = ((SingleFiling) sop).getPath();
int beginIndex = path.lastIndexOf(Filing.PATH_SEPARATOR) + 1; // Note
// :
// if
// /
// not
// found
// results in 0
String relPathSeg = path.substring(beginIndex, path.length());
parentData.setRelativePathSegment(relPathSeg);
result = Collections.singletonList((ObjectParentData) parentData);
} else
result = Collections.emptyList();
} else if (sop instanceof MultiFiling) {
result = new ArrayList<ObjectParentData>();
MultiFiling multiParentObj = (MultiFiling) sop;
List<Folder> parents = multiParentObj.getParents();
if (null != parents)
for (Folder parent : parents) {
ObjectParentDataImpl parentData = new ObjectParentDataImpl();
ObjectDataImpl objData = new ObjectDataImpl();
copyFilteredProperties(repositoryId, parent, filter, objData);
parentData.setObject(objData);
parentData.setRelativePathSegment(multiParentObj.getPathSegment());
result.add(parentData);
if (objectInfos != null) {
ObjectInfoImpl objectInfo = new ObjectInfoImpl();
fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, parent, objectInfo);
objectInfos.addObjectInfo(objectInfo);