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

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


                    }
                }
            } else {
               
                //create a new file
                r = (ContentResource) c.createChild(cursorFile.getName()
                            , ContentNode.Type.RESOURCE);
                try {
                    r.put(temp);
                    path = "wlcontent:/"+r.getPath();
                } catch (IOException ex) {
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);
                uri = "wlcontent:/"+r.getPath();
            } catch (IOException ex) {
View Full Code Here

        if (!audioFile.exists()) {
            throw new FileNotFoundException();
        }
        ContentNode node = recordingRoot.getChild(AUDIO_RECORDINGS_DIRECTORY);
        if (node == null) {
            node = recordingRoot.createChild(AUDIO_RECORDINGS_DIRECTORY, Type.COLLECTION);
        }
        ContentCollection dirNode = (ContentCollection) node;
        logger.info("directory for audio recordings: " + dirNode);
        String recordingName = audioFile.getName();
        logger.info("recording name: " + recordingName);
View Full Code Here

        node = dirNode.getChild(recordingName);
        if (node != null) {
            logger.info("recording already exists, so removing: " + recordingName);
            dirNode.removeChild(recordingName);
        }
        node = dirNode.createChild(recordingName, Type.RESOURCE);
        ContentResource resource = (ContentResource) node;
        logger.info("created a node for the audio file: " + resource);
        resource.put(audioFile);
    }
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

           
            ArrayList<ContentNode> resources = (ArrayList<ContentNode>)csColl.getChildren();
            if (resources != null && resources.size()!=0) {
                csColl.removeChild(resources.get(0).getName());
            }
            ContentResource resource = (ContentResource)csColl.createChild("LoginCoverScreen"+new Date().getTime()+".xml", Type.RESOURCE);

            // Write the new list to the resource
            ByteArrayOutputStream os = new ByteArrayOutputStream();
            Writer w = new OutputStreamWriter(os);
            loginCoverScreenInfo.encode(w);
View Full Code Here

            }
            ArrayList<ContentNode> resources = (ArrayList<ContentNode>)csColl.getChildren();
            if (resources != null && resources.size()!=0) {
                csColl.removeChild(resources.get(0).getName());
            }
            ContentResource resource = (ContentResource)csColl.createChild("GoToCoverScreen"+new Date().getTime()+".xml", Type.RESOURCE);
          
            // Write the new list to the resource
            ByteArrayOutputStream os = new ByteArrayOutputStream();
            Writer w = new OutputStreamWriter(os);
            goToCoverScreenInfo.encode(w);
View Full Code Here

        // Find the viewproperites.xml file, creating it if necessary.
        ContentCollection c = getUserContentRepository();
        ContentResource resource = (ContentResource)c.getChild(PROPS_FILE);
        if (resource == null) {
            resource = (ContentResource)c.createChild(PROPS_FILE, Type.RESOURCE);
        }

        // Write the new list to the resource
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        Writer w = new OutputStreamWriter(os);
View Full Code Here

      ContentCollection c = repo.getUserRoot();

      audioCollection = (ContentCollection) c.getChild("audio");

      if (audioCollection == null) {
    audioCollection = (ContentCollection) c.createChild("audio", Type.COLLECTION);
        }
        } catch (ContentRepositoryException e) {
      throw new AudioCacheHandlerException("Content repository exception: "
    + e.getMessage());
        }
View Full Code Here

        AvatarRegistry registry = AvatarRegistry.getAvatarRegistry();
        ContentCollection bc = registry.getAvatarCollection();
        try {
            imiCollection = (ContentCollection) bc.getChild("imi");
            if (imiCollection == null) {
                imiCollection = (ContentCollection) bc.createChild("imi", Type.COLLECTION);
            }
            logger.info("Using local IMI avatar collection " +
                    imiCollection.getPath());
        } catch (ContentRepositoryException excp) {
            logger.log(Level.WARNING, "Unable to fetch imi/ collection", excp);
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.