Class JCRLocalDropboxDrive.EventsSync

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected DropboxAPI api
      Internal API.
      • Fields inherited from interface org.exoplatform.services.cms.clouddrives.CloudDrive.Command

        COMPLETE
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected EventsSync()
      Create command for Template synchronization.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void apply​(org.exoplatform.services.cms.clouddrives.jcr.JCRLocalCloudFile local)
      Process locally applied file (it can be any extra operations including the gathering of effected files/stats or chunk saving in JCR).
      boolean canApply​(String parentId, String fileId)
      Answers if given file ID under its parent (by ID) already applied locally.
      protected void preSaveChunk()
      boolean removed​(String path)
      Adds the removed path to the scope of changes.
      protected void syncFiles()
      void undo​(org.exoplatform.services.cms.clouddrives.jcr.JCRLocalCloudFile local)
      Undo locally applied file or remove existing.
    • Field Detail

      • api

        protected final DropboxAPI api
        Internal API.
    • Constructor Detail

      • EventsSync

        protected EventsSync()
                      throws javax.jcr.RepositoryException,
                             org.exoplatform.services.cms.clouddrives.DriveRemovedException
        Create command for Template synchronization.
        Throws:
        javax.jcr.RepositoryException - the repository exception
        org.exoplatform.services.cms.clouddrives.DriveRemovedException - the drive removed exception
    • Method Detail

      • syncFiles

        protected void syncFiles()
                          throws org.exoplatform.services.cms.clouddrives.CloudDriveException,
                                 javax.jcr.RepositoryException
        Throws:
        org.exoplatform.services.cms.clouddrives.CloudDriveException
        javax.jcr.RepositoryException
      • apply

        public void apply​(org.exoplatform.services.cms.clouddrives.jcr.JCRLocalCloudFile local)
                   throws javax.jcr.RepositoryException,
                          org.exoplatform.services.cms.clouddrives.CloudDriveException
        Process locally applied file (it can be any extra operations including the gathering of effected files/stats or chunk saving in JCR).
        Specified by:
        apply in interface JCRLocalDropboxDrive.Changes
        Parameters:
        local - JCRLocalCloudFile changed file
        Throws:
        javax.jcr.RepositoryException - the repository exception
        org.exoplatform.services.cms.clouddrives.CloudDriveException - the cloud drive exception
      • undo

        public void undo​(org.exoplatform.services.cms.clouddrives.jcr.JCRLocalCloudFile local)
                  throws javax.jcr.RepositoryException,
                         org.exoplatform.services.cms.clouddrives.CloudDriveException
        Undo locally applied file or remove existing.
        Specified by:
        undo in interface JCRLocalDropboxDrive.Changes
        Parameters:
        local - the changed file
        Throws:
        javax.jcr.RepositoryException - the repository exception
        org.exoplatform.services.cms.clouddrives.CloudDriveException - the cloud drive exception
      • removed

        public boolean removed​(String path)
                        throws javax.jcr.RepositoryException,
                               org.exoplatform.services.cms.clouddrives.CloudDriveException
        Adds the removed path to the scope of changes. For a command JCRLocalCloudDrive.AbstractCommand it effectively should add the path to its removed list.
        Specified by:
        removed in interface JCRLocalDropboxDrive.Changes
        Parameters:
        path - the path
        Returns:
        true, if successful
        Throws:
        javax.jcr.RepositoryException - the repository exception
        org.exoplatform.services.cms.clouddrives.CloudDriveException - the cloud drive exception
      • canApply

        public boolean canApply​(String parentId,
                                String fileId)
        Answers if given file ID under its parent (by ID) already applied locally.
        Specified by:
        canApply in interface JCRLocalDropboxDrive.Changes
        Parameters:
        parentId - String
        fileId - String
        Returns:
        boolean, true if file was already applied, false otherwise.
      • preSaveChunk

        protected void preSaveChunk()
                             throws org.exoplatform.services.cms.clouddrives.CloudDriveException,
                                    javax.jcr.RepositoryException
        Throws:
        org.exoplatform.services.cms.clouddrives.CloudDriveException
        javax.jcr.RepositoryException