1 Reply Latest reply on Jul 18, 2013 5:00 PM by Naveeth_J

    How to copy files from one node to another node

    Naveeth_J Level 1

      How to copy files from one node with all its properties(metadata etc..) to another node programatically?

       

      say, a file has many childs

         test.ai

            |_ jcr:cotent

                  |_metadata

                      |_ xmp.....

                      ....

                  |_renditions

                    .....

       

      how do we copy this ai file from one node to another node with all those child information, properties?

       

      Currently, I am trying to use

       

              Node fileNode = node.addNode(name, JcrConstants.NT_FILE);

              Node jcrContent = fileNode.addNode(JcrConstants.JCR_CONTENT, JcrConstants.NT_RESOURCE);

              jcrContent.setProperty(JcrConstants.JCR_DATA, data);

       

      Is there any better api to copy the file directly with all its properties?