private static File copyStreamToFile(final InputStream stream, final File file) throws IOException {
    try (InputStream inputStream = stream;
         FileOutputStream outputStream = new FileOutputStream(file)) {
      FileUtil.copy(inputStream, outputStream);
    }
    return file;
  }
private static File copyStreamToFile(final InputStream stream, final File file)