Package com.composum.sling.nodes.update
Class SourceUpdateServiceImpl
- java.lang.Object
-
- com.composum.sling.nodes.update.SourceUpdateServiceImpl
-
- All Implemented Interfaces:
SourceUpdateService
public class SourceUpdateServiceImpl extends Object implements SourceUpdateService
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
SourceUpdateServiceImpl.ImportErrorListener
-
Constructor Summary
Constructors Constructor Description SourceUpdateServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
isArray(Object value)
protected org.apache.sling.api.resource.Resource
makeTempdir(org.apache.sling.api.resource.ResourceResolver resolver)
void
updateFromZip(@NotNull org.apache.sling.api.resource.ResourceResolver resolver, @NotNull InputStream rawZipInputStream, @NotNull String nodePath)
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.
-
-
-
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 interfaceSourceUpdateService
- Parameters:
resolver
- the resolver we write torawZipInputStream
- 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/somepathnodePath
- 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)
-
-