コード例 #1
0
 public final List<OtfGroup> getGroupsByApp(final OtfApplication app) {
   List<OtfGroup> groups = new ArrayList<OtfGroup>();
   for (OtfAccountStore acs : app.getAccountStores().values()) {
     if (acs.isDir()) {
       String dirName = acs.getName();
       groups.addAll(getGroupsByDirName(dirName));
     }
   }
   return groups;
 }
コード例 #2
0
  public final List<String> getOtfAppNamesForUser(final String username) {
    ArrayList<String> appsList = new ArrayList<String>();
    Collection<String> dirsforUser = getDirNamesForUser(username);

    for (OtfApplication app : getLocalModel().getApps().getApplications().values()) {
      for (String key : app.getAccountStores().keySet()) {
        if (dirsforUser.contains(key)) {
          appsList.add(app.getName());
        }
      }
    }
    return appsList;
  }
コード例 #3
0
  @Override
  public final List<String> getDirsByAppName(final String appnameIn) {
    List<String> dirs = new ArrayList<String>();
    OtfApplication oapp = getLocalModel().getApps().getAppByName(appnameIn);
    if (oapp != null) {
      Map<String, OtfAccountStore> acsmap = oapp.getAccountStores();
      if (acsmap != null && acsmap.size() > 0) {
        for (OtfAccountStore acs : acsmap.values()) {
          if (acs.isDir()) {
            dirs.add(acs.getName());
          }
        }
      }
    }

    return dirs;
  }