Class SourceUpdateServiceImpl

    • Constructor Detail

      • SourceUpdateServiceImpl

        public SourceUpdateServiceImpl()
    • Method Detail

      • updateFromZip

        public void updateFromZip​(@NotNull
                                  @NotNull org.apache.sling.api.resource.ResourceResolver resolver,
                                  @NotNull
                                  @NotNull InputStream rawZipInputStream,
                                  @NotNull
                                  @NotNull String nodePath)
                           throws IOException,
                                  javax.jcr.RepositoryException
        Reads a ZIP from the input stream and updates the resources at the path of the entries of the zip file so that they are identical to the stream, ignoring / updating metadata.

        Make subtree equivalent to a ZIP in vault format. General strategy: we update the attributes of all nodes according to the XML documents, creating nonexistent nodes along the way, and make node which nodes were present, and which were changed. In a second pass, we recurse through the JCR tree again, delete nodes that were not present and update the lastModified properties of nodes, below which there were changes.

        Specified by:
        updateFromZip in interface SourceUpdateService
        Parameters:
        resolver - the resolver we write to
        rawZipInputStream - contains a zip with the data to import. It needs to contain the actual content to import below jcr_root. E.g. if nodePath is /content/whatever, the zip contains the relevant content below jcr_root/content/whatever/somepath
        nodePath - the path of the node we want to update
        Throws:
        IOException
        javax.jcr.RepositoryException
      • makeTempdir

        protected org.apache.sling.api.resource.Resource makeTempdir​(org.apache.sling.api.resource.ResourceResolver resolver)
                                                              throws javax.jcr.RepositoryException
        Throws:
        javax.jcr.RepositoryException
      • isArray

        protected boolean isArray​(Object value)