class ExternalGroups extends GenericJson {

  public static ExternalGroups fromConfiguration() throws IOException {
    checkState(Configuration.isInitialized(), "configuration must be initialized");
    String groupsFilename = Configuration.getString(CONFIG_EXTERNALGROUPS_FILENAME, null).get();
    logger.log(Level.CONFIG, CONFIG_EXTERNALGROUPS_FILENAME + ": " + groupsFilename);
    File groupsFile = new File(groupsFilename);
    if (!(groupsFile.exists() && groupsFile.canRead())) {
      throw new InvalidConfigurationException(groupsFilename + " can't be read");
    }
    return fromFile(groupsFile);
  }

}