code: protected Node createScript(Node parent, String name, boolean autoload, InputStream stream) throws Exception
     {
        Node scriptFile = parent.addNode(name, "nt:file");
        Node script = scriptFile.addNode("jcr:content", getNodeType());
        script.setProperty("exo:autoload", autoload);
        script.setProperty("jcr:mimeType", "script/groovy");
        script.setProperty("jcr:lastModified", Calendar.getInstance());
        script.setProperty("jcr:data", stream);
        return scriptFile;
     }
docs: Create JCR node.
  
  @param parent parent node
  @param name name of node to be created
  @param stream data stream for property jcr:data
  @return newly created node
  @throws Exception if any errors occurs