code: private static void writeFile(final HttpQuery query,
                                  final String path,
                                  final byte[] contents) {
      try {
        final FileOutputStream out = new FileOutputStream(path);
        try {
          out.write(contents);
        } finally {
          out.close();
        }
      } catch (FileNotFoundException e) {
        logError(query, "Failed to create file " + path, e);
      } catch (IOException e) {
        logError(query, "Failed to write file " + path, e);
      }
    }
docs: Writes the given byte array into a file.
  This function logs an error but doesn't throw if it fails.
  @param query The query being handled (for logging purposes).
  @param path The path to write to.
  @param contents The contents to write into the file.