Class JCRLocalDropboxDrive.DropboxDrive.LocalItem

    • Constructor Detail

      • LocalItem

        protected LocalItem​(String dbxPath,
                            javax.jcr.Node node,
                            javax.jcr.Node parent,
                            List<String> relPath)
        Instantiates a new item location.
        Parameters:
        dbxPath - the dbxPath
        node - the node
        parent - the parent
        relPath - the rel dbxPath
    • Method Detail

      • exists

        public boolean exists()
        Tells if node of this item exists locally.
        Returns:
        true, if item exists locally, false otherwise
      • getNode

        public javax.jcr.Node getNode()
        Gets the local node of this item. If local item doesn't exist, then this method returns null and it's possible to call fetch(Changes) to fetch the item state from cloud side or apply existing state from metadata in update(ItemInfo, Changes).
        Returns:
        the node, can be null
      • removeNode

        public String removeNode()
                          throws javax.jcr.RepositoryException
        Removes the item node and return its path in local storage (JCR) or null if nothing found.
        Returns:
        the string or null if nothing removed
        Throws:
        javax.jcr.RepositoryException - the repository exception
      • update

        public javax.jcr.Node update​(JCRLocalDropboxDrive.ItemInfo item,
                                     JCRLocalDropboxDrive.Changes changes)
                              throws javax.jcr.RepositoryException,
                                     org.exoplatform.services.cms.clouddrives.CloudDriveException
        Update this local item with remote item state.
        Parameters:
        item - the item
        changes - the changes
        Returns:
        the node
        Throws:
        javax.jcr.RepositoryException - the repository exception
        org.exoplatform.services.cms.clouddrives.CloudDriveException - the cloud drive exception
      • move

        public javax.jcr.Node move​(JCRLocalDropboxDrive.ItemInfo toItem,
                                   JCRLocalDropboxDrive.Changes changes)
                            throws javax.jcr.RepositoryException,
                                   org.exoplatform.services.cms.clouddrives.CloudDriveException
        Move this local item to a location reflecting given remote item and update its state.
        Parameters:
        toItem - the to item
        changes - the changes
        Returns:
        the node
        Throws:
        javax.jcr.RepositoryException - the repository exception
        org.exoplatform.services.cms.clouddrives.CloudDriveException - the cloud drive exception
      • fetch

        public javax.jcr.Node fetch​(JCRLocalDropboxDrive.Changes changes)
                             throws javax.jcr.RepositoryException,
                                    org.exoplatform.services.cms.clouddrives.CloudDriveException
        Fetch the item state from remote side. Method returns a node of the local cloud item at the path or null if node not found remotely or its dbxPath was changed.
        Parameters:
        changes - the changes command related to the operation, not null
        Returns:
        the Node instance of local cloud file or null if no node updated.
        Throws:
        javax.jcr.RepositoryException - the repository exception
        org.exoplatform.services.cms.clouddrives.CloudDriveException - the cloud drive exception