public void createForm()

in ddm-rrm-form-management/src/main/java/com/epam/digital/data/platform/management/forms/service/FormServiceImpl.java [71:88]


  public void createForm(String formName, String content, String versionName) {
    var time = LocalDateTime.now();
    var repo =
        versionContextComponentManager.getComponent(versionName, VersionedFileRepository.class);
    String formPath = getFormPath(formName);
    var formAlreadyExistsException = new FormAlreadyExistsException(
        String.format("Form with path '%s' already exists", formPath));
    if (repo.isFileExists(formPath)) {
      throw formAlreadyExistsException;
    }

    content = addDatesToContent(content, time, time);
    try {
      repo.writeFile(formPath, content);
    } catch (FileAlreadyExistsException e) {
      throw formAlreadyExistsException;
    }
  }