src/main/java/org/apache/sling/testing/mock/jcr/MockSession.java
private void removeItemWithChildren(final String absPath) throws RepositoryException {
        if (!itemExists(absPath)) {
            return;
        }

        final ItemData parent = getItemData(absPath);
        final String descendantPrefix = parent.getPath() + "/";

        final List<String> pathsToRemove = new ArrayList<String>();
        pathsToRemove.add(parent.getPath());
        for (String itemPath : this.items.keySet()) {
            if (itemPath.startsWith(descendantPrefix)) {
                pathsToRemove.add(itemPath);
            }
        }
        for (String pathToRemove : pathsToRemove) {
            this.items.remove(pathToRemove);
        }

        hasKnownChanges = true;
    }
/**
     * Remove item incl. children
     * @param absPath Item path
     */
Remove item incl. children
@param absPath Item path
Remove item incl . children @param absPath Item path
private void removeItemWithChildren(final String absPath) throws RepositoryException {
        if (!itemExists(absPath)) {
            return;
        }
        final ItemData parent = getItemData(absPath);
        final String descendantPrefix = parent.getPath() + "/";
        final List<String> pathsToRemove = new ArrayList<String>();
        pathsToRemove.add(parent.getPath());
        for (String itemPath : this.items.keySet()) {
            if (itemPath.startsWith(descendantPrefix)) {
                pathsToRemove.add(itemPath);
            }
        }
        for (String pathToRemove : pathsToRemove) {
            this.items.remove(pathToRemove);
        }
        hasKnownChanges = true;
    }
private void removeItemWithChildren ( final String absPath ) throws RepositoryException { if ( ! itemExists ( absPath ) ) { return ; } final ItemData parent = getItemData ( absPath ) ; final String descendantPrefix = parent . getPath ( ) + "/" ; final List < String > pathsToRemove = new ArrayList < String > ( ) ; pathsToRemove . add ( parent . getPath ( ) ) ; for ( String itemPath : this . items . keySet ( ) ) { if ( itemPath . startsWith ( descendantPrefix ) ) { pathsToRemove . add ( itemPath ) ; } } for ( String pathToRemove : pathsToRemove ) { this . items . remove ( pathToRemove ) ; } hasKnownChanges = true ; }
Remove item incl.
Remove item incl .