code: public final Configuration getConfig(final File configFile, final InputStream configData)
              throws IOException {
          final Configuration configuration = this.context.getBean(Configuration.class);
          configuration.setConfigurationFile(configFile);
          MapfishPrintConstructor.setConfigurationUnderConstruction(configuration);
  
          final Configuration config =
                  this.yaml.load(new InputStreamReader(configData, "UTF-8"));
          if (this.doValidation) {
              final List<Throwable> validate = config.validate();
              if (!validate.isEmpty()) {
                  StringBuilder errors = new StringBuilder();
                  for (Throwable throwable: validate) {
                      errors.append("\n\t* ").append(throwable.getMessage());
                      LOGGER.error("Configuration Error found", throwable);
                  }
                  throw new Error(errors.toString(), validate.get(0));
              }
          }
          return config;
      }
docs: Create a configuration object from a config file.
  
  @param configFile the file that contains the configuration data.
  @param configData the config file data