code: private void updateContent(Node node, InputStream inputStream, List<String> mixins) throws RepositoryException
     {
  
        Node content = node.getNode("jcr:content");
  
        if (mimeTypeRecognizer.isMimeTypeRecognized() || !content.hasProperty("jcr:mimeType"))
        {
           content.setProperty("jcr:mimeType", mimeTypeRecognizer.getMimeType());
        }
  
        if (mimeTypeRecognizer.isEncodingSet())
        {
           content.setProperty("jcr:encoding", mimeTypeRecognizer.getEncoding());
        }
        content.setProperty("jcr:lastModified", Calendar.getInstance());
        content.setProperty("jcr:data", inputStream);
  
        for (String mixinName : mixins)
        {
           if (content.canAddMixin(mixinName))
           {
              content.addMixin(mixinName);
           }
        }
     }
docs: Updates jcr:content node.
  
  @param node parent node
  @param inputStream inputStream input stream that contains the content of
  file
  @param mixins list of mixins
  @throws RepositoryException  {@link RepositoryException}