private Node createZipEntryPath( Node parentNode,
                                     ZipEntry entry ) throws RepositoryException {
        Node zipEntryNode = parentNode;
        String entryName = entry.getName();
        String[] segments = entryName.split("/");
        for (int i = 0; i < segments.length; i++) {
            String segmentName = segments[i];
            try {
                zipEntryNode = zipEntryNode.getNode(segmentName);
            } catch (PathNotFoundException e) {
                // the path does not exist yet - create it
                boolean isLastSegment = (i == segments.length - 1);
                String segmentPrimaryType = isLastSegment ? (entry.isDirectory() ? JcrConstants.NT_FOLDER : JcrConstants.NT_FILE) : JcrConstants.NT_FOLDER;
                zipEntryNode = zipEntryNode.addNode(segmentName, segmentPrimaryType);
            }
        }
        return zipEntryNode;
    }
private Node createZipEntryPath ( Node parentNode , ZipEntry entry ) throws RepositoryException { Node zipEntryNode = parentNode ; String entryName = entry . getName ( ) ; String [ ] segments = entryName . split ( "/" ) ; for ( int i = 0 ; i < segments . length ; i ++ ) { String segmentName = segments [ i ] ; try { zipEntryNode = zipEntryNode . getNode ( segmentName ) ; } catch ( PathNotFoundException e ) { boolean isLastSegment = ( i == segments . length - 1 ) ; String segmentPrimaryType = isLastSegment ? ( entry . isDirectory ( ) ? JcrConstants . NT_FOLDER : JcrConstants . NT_FILE ) : JcrConstants . NT_FOLDER ; zipEntryNode = zipEntryNode . addNode ( segmentName , segmentPrimaryType ) ; } } return zipEntryNode ; }
Creates (if necessary) the path from the {@link Node parentNode} to the {@link ZipEntry zip entry}, based on the name of
the zip entry, which should contain its absolute path.

@param parentNode the parent node under which the node for the ZIP entry should be created
@param entry the ZIP file entry
@return the newly created node
@throws RepositoryException if there is a problem writing the content to the repository session