org.exoplatform.clouddrive.gdrive
Class JCRLocalGoogleDrive.Sync

java.lang.Object
  extended by org.exoplatform.clouddrive.gdrive.JCRLocalGoogleDrive.Sync
All Implemented Interfaces:
org.exoplatform.clouddrive.CloudDrive.Command
Enclosing class:
JCRLocalGoogleDrive

protected class JCRLocalGoogleDrive.Sync
extends Object

Sync algorithm for Google Drive.


Field Summary
protected  org.exoplatform.clouddrive.gdrive.GoogleDriveAPI api
          Google Drive service API.
protected  org.exoplatform.clouddrive.gdrive.GoogleDriveAPI.ChangesIterator changes
           
protected  Set<javax.jcr.Node> synced
          Existing files being synchronized with cloud.
 
Fields inherited from interface org.exoplatform.clouddrive.CloudDrive.Command
COMPLETE
 
Constructor Summary
protected JCRLocalGoogleDrive.Sync()
          Create command for Google Drive synchronization.
 
Method Summary
protected  void deleteFile(String fileId)
          Remove file's node.
protected  String[] getParents(com.google.api.services.drive.model.File gfile)
           
protected  void syncFiles()
          
protected  void syncNext()
           
protected  void updateFile(com.google.api.services.drive.model.File gf, String[] parentIds)
          Create or update file's node.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

api

protected final org.exoplatform.clouddrive.gdrive.GoogleDriveAPI api
Google Drive service API.


synced

protected final Set<javax.jcr.Node> synced
Existing files being synchronized with cloud.


changes

protected org.exoplatform.clouddrive.gdrive.GoogleDriveAPI.ChangesIterator changes
Constructor Detail

JCRLocalGoogleDrive.Sync

protected JCRLocalGoogleDrive.Sync()
                            throws javax.jcr.RepositoryException,
                                   org.exoplatform.clouddrive.DriveRemovedException
Create command for Google Drive synchronization.

Throws:
javax.jcr.RepositoryException
org.exoplatform.clouddrive.DriveRemovedException
Method Detail

syncFiles

protected void syncFiles()
                  throws javax.jcr.RepositoryException,
                         org.exoplatform.clouddrive.CloudDriveException

Throws:
javax.jcr.RepositoryException
org.exoplatform.clouddrive.CloudDriveException

syncNext

protected void syncNext()
                 throws javax.jcr.RepositoryException,
                        org.exoplatform.clouddrive.CloudDriveException
Throws:
javax.jcr.RepositoryException
org.exoplatform.clouddrive.CloudDriveException

deleteFile

protected void deleteFile(String fileId)
                   throws javax.jcr.RepositoryException
Remove file's node.

Parameters:
fileId - String
Throws:
javax.jcr.RepositoryException

updateFile

protected void updateFile(com.google.api.services.drive.model.File gf,
                          String[] parentIds)
                   throws org.exoplatform.clouddrive.CloudDriveException,
                          javax.jcr.RepositoryException
Create or update file's node.

Parameters:
gf - File
parentIds - array of Ids of parents (folders)
Throws:
org.exoplatform.clouddrive.CloudDriveException
IOException
javax.jcr.RepositoryException
InterruptedException

getParents

protected String[] getParents(com.google.api.services.drive.model.File gfile)


Copyright © 2003–2014 eXo Platform SAS. All rights reserved.