code: public static List<FileStoreDataSet> getDataSets(File cacheRoot)
      {
          if (cacheRoot == null)
          {
              String message = Logging.getMessage("nullValue.FileStorePathIsNull");
              Logging.logger().severe(message);
              throw new IllegalArgumentException(message);
          }
  
          ArrayList<FileStoreDataSet> datasets = new ArrayList<FileStoreDataSet>();
  
          File[] cacheDirs = FileStoreDataSet.listDirs(cacheRoot);
          for (File cacheDir : cacheDirs)
          {
              if (cacheDir.getName().equals("license"))
                  continue;
  
              File[] subDirs = FileStoreDataSet.listDirs(cacheDir);
              if (subDirs.length == 0)
              {
                  datasets.add(new FileStoreDataSet(cacheDir, cacheRoot.getPath()));
              }
              else
              {
                  // If the directory should be treated as a single dataset, add just one entry to the list.
                  if (isSingleDataSet(subDirs))
                  {
                      datasets.add(new FileStoreDataSet(cacheDir, cacheRoot.getPath()));
                  }
                  // Otherwise add each subdirectory as a separate data set.
                  else
                  {
                      for (File sd : subDirs)
                      {
                          FileStoreDataSet ds = new FileStoreDataSet(sd, cacheRoot.getPath());
                          datasets.add(ds);
                      }
                  }
              }
          }
  
          return datasets;
      }
docs: Find all of the data set directories in a cache root.
  
  @param cacheRoot Cache root to search.
  
  @return List of data sets in the specified cache.