ResourceVisitor.java 766 Bytes
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  org.apache.sling.api.resource.Resource
 */
package com.adobe.cq.mobile.dps.impl.contentsync;

import java.util.Iterator;
import org.apache.sling.api.resource.Resource;

public abstract class ResourceVisitor {
    public void visit(Resource res) {
        if (res != null) {
            this.accept(res);
            this.traverseChildren(res.listChildren());
        }
    }

    private void traverseChildren(Iterator<Resource> children) {
        while (children.hasNext()) {
            Resource child = children.next();
            this.accept(child);
            this.traverseChildren(child.listChildren());
        }
    }

    protected abstract void accept(Resource var1);
}