private boolean needsRecreate()

in src/main/java/org/apache/sling/jcr/repoinit/impl/UserVisitor.java [173:188]


    private boolean needsRecreate(@NotNull String id, @NotNull Authorizable authorizable, @NotNull String intermediatePath, @NotNull String type) throws RepositoryException {
        String path = getPath(authorizable);
        if (path != null) {
            String requiredIntermediate = intermediatePath + "/";
            if (!path.contains(requiredIntermediate)) {
                log.info("Recreating {} '{}' with path '{}' to match required intermediate path '{}'", type, id, path, intermediatePath);
                authorizable.remove();
                return true;
            } else {
                log.info("{} '{}' already exists with required intermediate path '{}', no changes made.", type, id, intermediatePath);
            }
        } else {
            log.error("{} '{}' already exists but path cannot be determined, no changes made.", type, id);
        }
        return false;
    }