Package org.jdesktop.wonderland.modules.contentrepo.common

Examples of org.jdesktop.wonderland.modules.contentrepo.common.ContentCollection.createChild()


        ContentCollection xAppsCollection = null;
        try {
            ContentCollection sysRoot = wcr.getSystemRoot();
            ContentNode xappsNode = sysRoot.getChild("x-apps");
            if (xappsNode == null) {
                xappsNode = sysRoot.createChild("x-apps", Type.COLLECTION);
            }
            xAppsCollection = (ContentCollection)xappsNode;
        } catch (ContentRepositoryException excp) {
            logger.log(Level.WARNING, "Unable to get x-apps collection", excp);
            error(request, response, "No x-apps collection found. <br>" +
View Full Code Here


        // new bits. Otherwise create the resource and upload the new bits
        try {
            userRoot = repo.getUserRoot();
            ContentNode node = (ContentNode)userRoot.getChild(fileName);
            if (node == null) {
                node = (ContentNode)userRoot.createChild(fileName, Type.RESOURCE);
            }
            ((ContentResource)node).put(file);
        } catch (ContentRepositoryException excp) {
            LOGGER.log(Level.WARNING, "Error uploading", excp);
        } catch(IOException ie) {
View Full Code Here

        // the login name can change.
        ContentCollection localContent = ContentRepositoryRegistry.getInstance().getLocalRepository();
        try {
            avatarCollection = (ContentCollection) localContent.getChild("avatars");
            if (avatarCollection == null) {
                avatarCollection = (ContentCollection) localContent.createChild("avatars", Type.COLLECTION);
            }
        } catch (ContentRepositoryException ex) {
            LOGGER.log(Level.SEVERE, null, ex);
        }
View Full Code Here

        // and look for the file <app name>.xml.
        ContentCollection userNode = getUserXAppContentCollection();
        String nodeName = item.getAppName() + ".xml";
        ContentNode appNode = userNode.getChild(nodeName);
        if (appNode == null) {
            appNode = userNode.createChild(nodeName, Type.RESOURCE);
        }
        ContentResource resource = (ContentResource)appNode;
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        Writer w = new OutputStreamWriter(os);
        item.encode(w);
View Full Code Here

                 */
                ContentResource r = (ContentResource) c.removeChild(image.getName());
            } catch (Exception e) {
            }
           
            ContentResource r = (ContentResource) c.createChild(
                image.getName(), ContentNode.Type.RESOURCE);
            try {
               
                r.put(image);
               
View Full Code Here

        File file = chooser.getSelectedFile();
        String name = file.getName();
        if (file.exists() == true) {
            try {
                ContentCollection c = (ContentCollection) treeSelectedNode;
                ContentResource r = (ContentResource) c.createChild(
                        name, ContentNode.Type.RESOURCE);
                r.put(file);
                jtable.setContentCollection(c);
            } catch (java.lang.Exception excp) {
                logger.log(Level.WARNING, "Unable to upload " + file, excp);
View Full Code Here

        // Go ahead and create the new directory in the content repository
        String name = s.trim();
        try {
            ContentCollection collection = (ContentCollection) treeSelectedNode;
            collection.createChild(name, ContentNode.Type.COLLECTION);
            jtree.refresh();
            jtable.setContentCollection(collection);
        } catch (ContentRepositoryException ex) {
            logger.log(Level.WARNING, "Unable to create directory " + name, ex);
View Full Code Here

        // new bits. Otherwise create the resource and upload the new bits
        try {
            userRoot = repo.getUserRoot();
            ContentNode node = (ContentNode)userRoot.getChild(fileName);
            if (node == null) {
                node = (ContentNode)userRoot.createChild(fileName, Type.RESOURCE);
            }
            ((ContentResource)node).put(file);
        } catch (ContentRepositoryException excp) {
            logger.log(Level.WARNING, "Error while trying to find " + fileName +
                    " in content repository", excp);
View Full Code Here

                FileItemStream item = iter.next();
                String name = item.getName();
                InputStream stream = item.openStream();
                if (item.isFormField() == false) {
                    ContentResource child = (ContentResource)
                            dir.createChild(name, ContentNode.Type.RESOURCE);

                    File tmp = File.createTempFile("contentupload", "tmp");
                    RunUtil.writeToFile(stream, tmp);
                    child.put(tmp);
                    tmp.delete();
View Full Code Here

        // Try to find the "placemarks.xml" file. If it does not exist, then
        // create it with an empty PlacemarksList.
        ContentResource r = (ContentResource)c.getChild("placemarks.xml");
        if (r == null) {
            r = (ContentResource)c.createChild("placemarks.xml", Type.RESOURCE);
            PlacemarkList placemarkList = new PlacemarkList();
            ByteArrayOutputStream os = new ByteArrayOutputStream();
            Writer w = new OutputStreamWriter(os);
            placemarkList.encode(w);
            r.put(os.toByteArray());
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.