Task #19087 added also the method getParentsForExplorerById

This commit is contained in:
Francesco Mangiacrapa 2020-04-17 14:43:14 +02:00
parent 0abef7f2d1
commit 7792737ae1
2 changed files with 41 additions and 1 deletions

View File

@ -402,6 +402,35 @@ public final class WorkspaceStorageHubClientService implements Workspace{
return toParents;
}
/**
* Gets the parents for explorer by id. This call is the same of {@link WorkspaceStorageHubClientService#getParentsById(String)}
* except to getRoot called inside (to check if a parent is root or not). {@link WorkspaceItem#isRoot()} returns always false.
*
* @param id the id
* @return the parents for explorer by id
* @throws InternalErrorException the internal error exception
* @throws Exception the exception
*/
@Override
public List<? extends WorkspaceItem> getParentsForExplorerById(String id)
throws InternalErrorException, Exception {
LOGGER.debug("called get Parents by Id");
Validate.notNull(id,"The input id is null");
List<? extends Item> parents = storageHubClientService.getParents(id);
List<WorkspaceItem> toParents = new ArrayList<WorkspaceItem>(parents.size());
for (Item item : parents) {
WorkspaceItem child = HLMapper.toWorkspaceItem(item, withAccounting, withFileDetails, withMapProperties);
//setIsRoot((org.gcube.common.storagehubwrapper.shared.tohl.impl.WorkspaceItem) child);
toParents.add(child);
}
return toParents;
}
/**
* Creates the folder.

View File

@ -515,7 +515,7 @@ public interface Workspace{
throws InternalErrorException, ItemNotFoundException, WrongItemTypeException;
/**
* Gets the item.
* Gets the item for Explorer
*
* @param itemId the item id
* @param withAccounting the with accounting
@ -528,6 +528,17 @@ public interface Workspace{
*/
WorkspaceItem getItemForExplorer(String itemId, boolean withAccounting, boolean withFileDetails,
boolean withMapProperties) throws ItemNotFoundException, InternalErrorException, Exception;
/**
* Gets the parents for explorer by id. This call is the same of {@link WorkspaceStorageHubClientService#getParentsById(String)}
* except to getRoot called inside (to check if a parent is root or not). {@link WorkspaceItem#isRoot()} returns always false.
*
* @param id the id
* @return the parents for explorer by id
* @throws InternalErrorException the internal error exception
* @throws Exception the exception
*/
List<? extends WorkspaceItem> getParentsForExplorerById(String id) throws InternalErrorException, Exception;
/*
*