private void copyWithFiltering(File file, File outputFile) throws IOException {
    final String encoding = myEncodingConfig != null? myEncodingConfig.getEncoding(file) : null;
    PrintWriter writer;
    try {
      writer = encoding != null ? new PrintWriter(outputFile, encoding) : new PrintWriter(outputFile);
    }
    catch (FileNotFoundException e) {
      final File parentFile = outputFile.getParentFile();
      if (parentFile == null || !parentFile.mkdirs() && !outputFile.setWritable(true)) {
        throw e; // all possible problem resolutions failed, so rethrow the error
      }
      writer = encoding != null ? new PrintWriter(outputFile, encoding) : new PrintWriter(outputFile);
    }
    try {
      final byte[] bytes = FileUtil.loadFileBytes(file);
      final String text = encoding != null? new String(bytes, encoding) : new String(bytes, StandardCharsets.UTF_8);
      doFilterText(text, getDelimitersPattern(), getProperties(), null, writer);
    }
    finally {
      writer.close();
    }
  }
private void copyWithFiltering(File file, File outputFile)