コード例 #1
0
ファイル: GroupUtils.java プロジェクト: NCIP/cagrid-general
 public static boolean subgroupExists(StemI stem, String systemNameOfGroup) {
   Set<GroupI> existingGroups = stem.getChildGroups();
   for (GroupI group : existingGroups) {
     if (group.getExtension().equals(systemNameOfGroup)) {
       return true;
     }
   }
   return false;
 }
コード例 #2
0
ファイル: GroupUtils.java プロジェクト: NCIP/cagrid-general
 /**
  * Return a stem with matching group (sytem) extension, or null if that group doesn't exist
  *
  * @param groupExtension the extension of the group to find
  * @return
  */
 public static GroupI findChildGroup(StemI stem, String groupExtension) {
   Set<GroupI> groups = stem.getChildGroups();
   for (GroupI group : groups) {
     if (group.getExtension().equals(groupExtension)) {
       return group;
     }
   }
   return null;
 }
コード例 #3
0
ファイル: GroupUtils.java プロジェクト: NCIP/cagrid-general
 /**
  * WARNING: this will remove all sub-groups and sub-stems recursively. The stem itself is left
  * unchanged.
  *
  * @param stem
  * @throws InsufficientPrivilegeException
  * @throws GroupDeleteException
  * @throws StemDeleteException
  */
 public static void deleteStemHierarchy(StemI curStem)
     throws GroupDeleteException, InsufficientPrivilegeException, StemDeleteException {
   Set<StemI> subStems = (Set<StemI>) curStem.getChildStems();
   for (StemI stem : subStems) {
     deleteStemHierarchy(stem);
     stem.delete();
   }
   Set<GroupI> groups = (Set<GroupI>) curStem.getChildGroups();
   for (GroupI group : groups) {
     deleteGroup(group);
   }
 }