Examples of ContentCollection


Examples of org.jdesktop.wonderland.modules.contentrepo.common.ContentCollection

    protected ContentNode translatePath(WebContentRepository wcr, String path)
        throws ContentRepositoryException
    {
        // find the root (system or users)
        ContentCollection root = null;

        if (path == null || path.equals("/")) {
            root = wcr.getRoot();
        } else if (path.startsWith("/system")) {
            path = path.substring("/system".length());
            root = wcr.getSystemRoot();
        } else if (path.startsWith("/users/")) {
            path = path.substring("/users/".length());
            String userId = path;

            int endIdx = path.indexOf("/");
            if (endIdx != -1) {
                userId = path.substring(0, endIdx);
                path = path.substring(endIdx);
            } else {
                path = null;
            }

            root = wcr.getUserRoot(userId);
        } else {
            root = wcr.getRoot();
        }

        if (root == null) {
            return null;
        }

        if (path == null || path.length() == 0 || path.equals("/")) {
            return root;
        }

        return root.getChild(path);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.