docs: public static JsonSchema getSchemaFromPath(FileSystem fs, Path path, boolean checkSameSchema)
              throws IOException {
          try {
              if(fs.isFile(path)) {
                  // this is a normal file, get a schema from it
                  Map<String, String> m = HadoopUtils.getMetadataFromSequenceFile(fs, path);
                  if(!m.containsKey("value.schema") || !m.containsKey("key.schema"))
                      throw new IllegalArgumentException("No JSON schema found on file " + path.toString());
                  return new JsonSchema(JsonTypeDefinition.fromJson(m.get("key.schema")),
                                        JsonTypeDefinition.fromJson(m.get("value.schema")));
              } else {
                  FileStatus[] statuses = null;
                  if(fs.isDirectory(path)) {
                      // this is a directory, get schemas from all subfiles
                      statuses = fs.listStatus(path);
                  } else {
                      // this is wildcard path, get schemas from all matched files
                      statuses = fs.globStatus(path);
                  }
                  if(statuses == null || statuses.length == 0)
                      throw new IllegalArgumentException("No JSON files found in path pattern "
                                                         + path.toUri().getPath());
                  List<JsonSchema> schemas = new ArrayList<JsonSchema>();
                  for(FileStatus status: statuses) {
                      if(!HadoopUtils.shouldPathBeIgnored(status.getPath())) {
                          if(!checkSameSchema) {
                              // return first valid schema w/o checking all files
                              return getSchemaFromPath(fs, status.getPath(), checkSameSchema);
                          }
                          schemas.add(getSchemaFromPath(fs, status.getPath(), checkSameSchema));
                      }
                  }
  
                  // now check that all the schemas are the same
                  if(schemas.size() > 0) {
                      JsonSchema schema = schemas.get(0);
                      for(int i = 1; i < schemas.size(); i++)
                          if(!schema.equals(schemas.get(i)))
                              throw new IllegalArgumentException("The directory "
                                                                 + path.toString()
                                                                 + " contains heterogenous JSON schemas: found both '"
                                                                 + schema.toString() + "' and '"
                                                                 + schemas.get(i).toString() + "'.");
  
                      return schema;
                  } else {
                      throw new IllegalArgumentException("No valid JSON metedata file found for Path:"
                                                         + path.toString());
                  }
              }
          } catch(Exception e) {
              logger.error("failed to get JSON metadata from path:" + path);
              throw new RuntimeException(e);
          }
      }