code: public static File convert(File props, boolean backup) throws IOException {
          if (!props.isFile()) {
              throw new IllegalArgumentException("The given properties file does not exist : " + props.getAbsolutePath());
          }
  
          Properties properties;
          try {
              properties = readFileAsProperties(props);
          } catch (IOException e) {
              throw new IllegalArgumentException("Cannot convert " + props.getName() + " to hocon - the file is not a " +
                      "valid properties file", e);
          }
  
          // Properties cannot be null there, but might be empty
          if (properties == null || properties.isEmpty()) {
              throw new IllegalArgumentException("Cannot convert an empty file : " + props.getAbsolutePath());
          }
  
          // The conversion can start
          if (backup) {
              // Generate backup
              try {
                  generateBackup(props);
              } catch (IOException e) {
                  throw new IllegalStateException("Cannot generate the backup for " + props.getName(), e);
              }
          }
  
          String hocon = convertToHocon(props);
          File output = props;
          if (!props.getName().endsWith(".conf")) {
              // Replace extension
              output = new File(props.getParentFile(),
                      props.getName().substring(0, props.getName().lastIndexOf(".")) + ".conf");
          }
          FileUtils.write(output, hocon);
          return output;
      }
docs: Converts the given properties file (props) to hocon.
  
  @param props  the properties file, must exist and be a valid properties file.
  @param backup whether or not a backup should be generated. It backup is set to true, a ".backup" file is
  generated before the conversion.
  @return the output file. It's the input file, except if the props' name does not end with ".conf", in that
  case it generates a new file with this extension.
  @throws IOException if something bad happens.