code: private void updateVersion(Node fileNode, InputStream inputStream, String autoVersion, List<String> mixins)
        throws RepositoryException
     {
        if (!fileNode.isCheckedOut())
        {
           fileNode.checkout();
           fileNode.getSession().save();
        }
        if (CHECKOUT.equals(autoVersion))
        {
           updateContent(fileNode, inputStream, mixins);
        }
        else if (CHECKOUT_CHECKIN.equals(autoVersion))
        {
           updateContent(fileNode, inputStream, mixins);
           fileNode.getSession().save();
           fileNode.checkin();
        }
        fileNode.getSession().save();
     }
docs: Updates the content of the versionable file according to auto-version value.
  
  @param fileNode Node to update
  @param inputStream input stream that contains the content of
  file
  @param autoVersion auto-version value
  @param mixins list of mixins
  @throws RepositoryException {@link RepositoryException}