Package org.jdesktop.wonderland.modules.contentrepo.client

Examples of org.jdesktop.wonderland.modules.contentrepo.client.ContentRepository


     * Returns the content repository root for the current user, or null upon
     * error.
     */
    private ContentCollection getUserRoot() {
        ContentRepositoryRegistry reg = ContentRepositoryRegistry.getInstance();
        ContentRepository repo = reg.getRepository(loginInfo);
        try {
            return repo.getUserRoot();
        } catch (ContentRepositoryException excp) {
            LOGGER.log(Level.WARNING, "Unable to find repository root", excp);
            return null;
        }
    }
View Full Code Here


        }
       
        //upload image
        String path = origCursorFilePath;
        ContentRepositoryRegistry registry = ContentRepositoryRegistry.getInstance();
        ContentRepository repo = registry.getRepository(LoginManager.getPrimary());
        try {
            ContentCollection c = repo.getUserRoot();
            ContentResource r = (ContentResource) c.getChild(cursorFile.getName());

            if(r!=null) {

                //file is already exist
View Full Code Here

     * Returns the content repository root for the system root, or null upon
     * error.
     */
    private ContentCollection getSystemRoot(ServerSessionManager loginInfo) {
        ContentRepositoryRegistry registry = ContentRepositoryRegistry.getInstance();
        ContentRepository repo = registry.getRepository(loginInfo);
        if (repo == null) {
            logger.severe("Repository is null");
            return null;
        }
        try {
            return repo.getSystemRoot();
        } catch (ContentRepositoryException excp) {
            logger.log(Level.SEVERE, "Unable to find repository root", excp);
            return null;
        }
    }
View Full Code Here

            Logger.getLogger(PlacemarkComponentProperties.class.getName()).log(Level.SEVERE, null, ex);
        }
       
        String uri = "";
        ContentRepositoryRegistry registry = ContentRepositoryRegistry.getInstance();
        ContentRepository repo = registry.getRepository(LoginManager.getPrimary());
        try {
            ContentCollection c = repo.getUserRoot();
            try {
                /*
                 * Remove file if it exists.
                 */
                ContentResource r = (ContentResource) c.removeChild(image.getName());
View Full Code Here

     */
    private static ContentCollection getSystemContentRepository()
            throws ContentRepositoryException {

        ContentRepositoryRegistry registry = ContentRepositoryRegistry.getInstance();
        ContentRepository cr = registry.getRepository(serverSessionManager);
        return cr.getSystemRoot();
    }
View Full Code Here

    }
    private static ContentCollection getSystemContentRepository(ServerSessionManager serverSessionManager)
            throws ContentRepositoryException {

        ContentRepositoryRegistry registry = ContentRepositoryRegistry.getInstance();
        ContentRepository cr = registry.getRepository(serverSessionManager);
        return cr.getSystemRoot();
    }
View Full Code Here

        private Image scaleImage(URL imageURL,int width, int height) {
            try {
                Image scaledBimg = null;
                ContentRepositoryRegistry registry = ContentRepositoryRegistry.getInstance();
                ContentRepository cr = registry.getRepository(LoginManager.getPrimary());
                String[] urls = imageURL.toString().split("/");
                String fname = urls[urls.length-1];
                String userName = urls[3];
                ContentCollection user = cr.getUserRoot(userName);
               
                ContentResource res = (ContentResource) user.getChild(fname);
               
                BufferedImage bimg = ImageIO.read(res.getInputStream());
                if(bimg.getWidth()>width || bimg.getHeight()>height) {
View Full Code Here

        private Image scaleImage(URL imageURL,int width, int height) {
            try {
                Image scaledBimg = null;
                ContentRepositoryRegistry registry = ContentRepositoryRegistry.getInstance();
                ContentRepository cr = registry.getRepository(serverSessionManager);
                String[] urls = imageURL.toString().split("/");
                String fname = urls[urls.length-1];
                String userName = urls[3];
                ContentCollection user = cr.getUserRoot(userName);
               
                ContentResource res = (ContentResource) user.getChild(fname);
               
                BufferedImage bimg = ImageIO.read(res.getInputStream());
                if(bimg.getWidth()>width || bimg.getHeight()>height) {
View Full Code Here

  logger.warning("Upload File: " + s);

        ContentRepositoryRegistry registry = ContentRepositoryRegistry.getInstance();

        ContentRepository repo = registry.getRepository(LoginManager.getPrimary());
 
        ContentCollection audioCollection = null;

        try {
      ContentCollection c = repo.getUserRoot();

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

      if (audioCollection == null) {
    audioCollection = (ContentCollection) c.createChild("audio", Type.COLLECTION);
View Full Code Here

   
    private String uploadImage(File image) {

        String uri = "";
        ContentRepositoryRegistry registry = ContentRepositoryRegistry.getInstance();
        ContentRepository repo = registry.getRepository(LoginManager.getPrimary());
        try {
            ContentCollection c = repo.getUserRoot();
            try {
                /*
                 * Remove file if it exists.
                 */
                ContentResource r = (ContentResource) c.removeChild(image.getName());
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.modules.contentrepo.client.ContentRepository

Copyright © 2018 www.massapicom. 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.