code: public File generate(File outputDir, boolean zip, boolean prettyJson) throws IOException {
          if (request == null) {
              throw new IllegalStateException("Update inventory request is null");
          }
  
          // prepare working directory
          File workDir = new File(outputDir, "whitesource");
          if (!workDir.exists() && !workDir.mkdir()) {
              throw new IOException("Unable to make output directory: " + workDir);
          }
  
          String json;
          if (zip) {
              json = new Gson().toJson(request);
              json = ZipUtils.compressString(json);
          } else if (prettyJson) {
              Gson gson = new GsonBuilder().setPrettyPrinting().create();
              json = gson.toJson(request);
          } else {
              json = new Gson().toJson(request);
          }
  
          // write to file
          File requestFile = new File(workDir, "update-request.txt");
          FileUtils.writeStringToFile(requestFile, json, UTF_8);
          return requestFile;
      }
docs: The method generates the update request file.
  
  @param outputDir Directory where request file will be created.
  @param zip Whether or not to zip the request.
  @param prettyJson Whether or not to parse the json before writing to file (only if zip is false).
  
  @return File reference to the resulting request.
  @throws java.io.IOException In case of errors during file generation process.