code: private File getTargetFile(File sourceFile, OutputFormat selectedOutputFormat) throws IOException {
  
      File sourceDirectory = getSourceDirectory();
      String relativePath = StringUtils.substringAfter(sourceFile.getAbsolutePath(), sourceDirectory.getAbsolutePath());
      String relativeTargetPath = FileUtils.removeExtension(relativePath) + "." + selectedOutputFormat.getFileExtension();
  
      File jsonFile = new File(getGeneratedResourcesFolder().getPath() + relativeTargetPath);
  
      jsonFile = jsonFile.getCanonicalFile();
  
      File parentDirectory = jsonFile.getParentFile();
      if (!parentDirectory.exists()) {
        parentDirectory.mkdirs();
        buildContext.refresh(parentDirectory);
      }
  
      return jsonFile;
    }
docs: Get the JSON file for source file.
  @param sourceFile the source file
  @param selectedOutputFormat Output format
  @return File with name and path based on file parameter
  @throws IOException