code: private static String readJsonVersionedFile(Path dir, String version, String type) throws IOException {
          Path file = dir.resolve(version).resolve(type + ".json");
          return new String(Files.readAllBytes(file), StandardCharsets.UTF_8);
      }
docs: Reads a mapping from dir/version/type.json file
  
  @param dir Directory containing mapping files per major version
  @param version Elasticsearch major version number (only major digit is kept so for 2.3.4 it will be 2)
  @param type The expected type (will be expanded to type.json)
  @return the mapping
  @throws IOException If the mapping can not be read