/** * Obtains the resource java beans containing the requested entries. * * @param entryList List of entry ids in string format. * @param studyStr Study id in string format. Could be one of [id|user@aliasProject:aliasStudy|aliasProject:aliasStudy|aliasStudy]. * @param sessionId Session id of the user logged. * @return the resource java beans containing the requested entries. * @throws CatalogException when more than one entry is found. */ public AbstractManager.MyResources<R> getUids(List<String> entryList, @Nullable String studyStr, String sessionId) throws CatalogException { String userId = catalogManager.getUserManager().getUserId(sessionId); Study study = catalogManager.getStudyManager().resolveId(studyStr, userId); List<R> finalEntryList = new ArrayList<>(entryList.size()); for (String entryStr : entryList) { R entry = smartResolutor(study.getUid(), entryStr, userId); finalEntryList.add(entry); } return new MyResources<>(userId, study, finalEntryList); }
/** * Obtains the resource java bean containing the requested entries. * * @param entryStr Entry id in string format. * @param studyStr Study id in string format. Could be one of [id|user@aliasProject:aliasStudy|aliasProject:aliasStudy|aliasStudy]. * @param sessionId Session id of the user logged. * @return the resource java bean containing the requested entries. * @throws CatalogException when more than one entry is found. */ public AbstractManager.MyResource<R> getUid(String entryStr, @Nullable String studyStr, String sessionId) throws CatalogException { ParamUtils.checkObj(entryStr, "id"); String userId = catalogManager.getUserManager().getUserId(sessionId); Study study = catalogManager.getStudyManager().resolveId(studyStr, userId); if (entryStr.contains(",")) { throw new CatalogException("More than one entry found"); } R entry = smartResolutor(study.getUid(), entryStr, userId); return new MyResource<>(userId, study, entry); }