Class JCRLocalDropboxDrive.DropboxDrive

    • Field Detail

      • api

        protected final DropboxAPI api
        Cloud drive API.
      • rootNode

        protected final javax.jcr.Node rootNode
        The root node of the tree.
      • pathNodes

        protected final Map<String,​javax.jcr.Node> pathNodes
        Nodes read/created by Dropbox path in this sync.
    • Constructor Detail

      • DropboxDrive

        protected DropboxDrive​(DropboxAPI api,
                               javax.jcr.Node rootNode)
        Instantiates a new drive tree.
        Parameters:
        api - the api
        rootNode - the root node
    • Method Detail

      • close

        protected void close()
        Close the tree and cleanup its temporal resources.
      • getRemotePath

        public String getRemotePath​(String jcrPath)
                             throws javax.jcr.RepositoryException
        Construct a Dropbox path of an item from given JCR path.
        Parameters:
        jcrPath - the JCR path
        Returns:
        the remote path
        Throws:
        javax.jcr.RepositoryException - the repository exception
      • getLocalPath

        public String getLocalPath​(String dbxPath)
                            throws javax.jcr.RepositoryException
        Construct a JCR path of an item from given Dropbox path.
        Parameters:
        dbxPath - the dbx path
        Returns:
        the local path
        Throws:
        javax.jcr.RepositoryException - the repository exception
      • findByLocalPath

        public JCRLocalDropboxDrive.DropboxDrive.LocalItem findByLocalPath​(String jcrPath)
                                                                    throws javax.jcr.RepositoryException
        Find local item by its path in the storage (JCR). If given path outside the drive root node then null will be returned.
        Parameters:
        jcrPath - the JCR path
        Returns:
        the local item or null of path outside the drive root node
        Throws:
        javax.jcr.RepositoryException - the repository exception
      • readItem

        protected JCRLocalDropboxDrive.DropboxDrive.LocalItem readItem​(String dbxPath)
                                                                throws javax.jcr.RepositoryException
        Read item from local storage.
        Parameters:
        dbxPath - the Dropbox path
        Returns:
        the node location
        Throws:
        javax.jcr.RepositoryException - the repository exception
      • findDropboxNode

        @Deprecated
        protected javax.jcr.Node findDropboxNode​(String dbxPath)
                                          throws javax.jcr.RepositoryException
        Deprecated.
        Find node by Dropbox dbxPath property.
        Parameters:
        dbxPath - the Dropbox dbxPath
        Returns:
        the node
        Throws:
        javax.jcr.RepositoryException - the repository exception
      • restore

        public javax.jcr.Node restore​(javax.jcr.Node node)
                               throws javax.jcr.RepositoryException
        Restore given node at a Dropbox path saved in it or remove the node if it's a connected cloud file.
        Parameters:
        node - the node
        Returns:
        the node or null if node cannot be found or was removed
        Throws:
        javax.jcr.RepositoryException - the repository exception