class ResourceVersionedSchemaSetProvider implements VersionedSchemaSetProvider {

  @Override
  public VersionedSchemaSet loadSchemas()
  {
    VersionedSchemaSet result = new VersionedSchemaSet();

    InputStream indexIns = null;
    indexIns = _classLoader.getResourceAsStream(INDEX_RESOURCE_NAME);
    if (null == indexIns)
    {
      LOG.info("resource not found: " + INDEX_RESOURCE_NAME + "; no schemas will be loaded");
    }
    else
    {
      BufferedReader indexReader = null;
      try
      {
        indexReader = new BufferedReader(new InputStreamReader(indexIns, "UTF-8"));

        List<String> resourceNames = readIndex(indexReader);
        LOG.info("schema resources found: " + resourceNames);
        for (String resource: resourceNames)
        {
          VersionedSchema schema = readSchemaFromResource(resource);
          if (null != schema) result.add(schema);
        }
      }
      catch (IOException ioe)
      {
        LOG.error("i/o error: " + ioe.getMessage(), ioe);
      }
      finally
      {
        try {
          indexIns.close();
          if (null != indexReader) indexReader.close();
        }
        catch (IOException e1)
        {
          LOG.error("cleanup failed: " + e1.getMessage(), e1);
        }
      }
    }
    return result;
  }

  public  ResourceVersionedSchemaSetProvider(ClassLoader classLoader);

}