|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exoplatform.clouddrive.CloudDrive
org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive
org.exoplatform.clouddrive.gdrive.JCRLocalGoogleDrive
public class JCRLocalGoogleDrive
JCR local storage for Google Drive. Created by The eXo Platform SAS.
| Nested Class Summary | |
|---|---|
protected class |
JCRLocalGoogleDrive.Connect
Connect algorithm for Google Drive. |
protected class |
JCRLocalGoogleDrive.FileAPI
|
protected class |
JCRLocalGoogleDrive.Sync
Sync algorithm for Google Drive. |
| Nested classes/interfaces inherited from class org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive |
|---|
org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive.AbstractCommand, org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive.AbstractFileAPI, org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive.CommandCallable, org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive.ConnectCommand, org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive.ExoJCREnvironment, org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive.ExoJCRSettings, org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive.FileChange, org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive.JCRListener, org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive.NoConnectCommand, org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive.NoSyncCommand, org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive.SyncCommand, org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive.SyncFilesCommand |
| Nested classes/interfaces inherited from class org.exoplatform.clouddrive.CloudDrive |
|---|
org.exoplatform.clouddrive.CloudDrive.Command, org.exoplatform.clouddrive.CloudDrive.CommandProgress, org.exoplatform.clouddrive.CloudDrive.ListenerSupport |
| Field Summary |
|---|
| Fields inherited from class org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive |
|---|
accentsConverter, actionDrive, ALREADY_DONE, commandEnv, commandExecutor, CURRENT_LOCALFORMAT, currentChangeId, currentConnect, currentSync, DUMMY_DATA, ECD_CLOUDDRIVE, ECD_CLOUDFILE, ECD_CLOUDFILERESOURCE, ECD_CLOUDFOLDER, ECD_IGNORED, ECD_LOCALFORMAT, EXO_DATETIME, EXO_MODIFY, EXO_THUMBNAIL, EXO_THUMBNAILS, EXO_TRASHFOLDER, fileAPI, fileChanges, fileChangeSequencer, fileCopies, fileHistory, fileRemovals, fileSynchronizers, fileTrash, finder, HISTORY_EXPIRATION, HISTORY_MAX_LENGTH, jcrListener, MIX_REFERENCEABLE, noConnect, noSyncCommand, NT_FILE, NT_FOLDER, NT_RESOURCE, NT_UNSTRUCTURED, repository, rootNodeHolder, rootUUID, rootWorkspace, sessionProviders, syncLock, user, USER_NODEPATH, USER_SESSIONPROVIDER, USER_WORKSPACE |
| Fields inherited from class org.exoplatform.clouddrive.CloudDrive |
|---|
listeners, LOG |
| Constructor Summary | |
|---|---|
protected |
JCRLocalGoogleDrive(org.exoplatform.clouddrive.gdrive.GoogleDriveConnector.API apiBuilder,
GoogleProvider provider,
javax.jcr.Node driveNode,
org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviders,
org.exoplatform.clouddrive.jcr.NodeFinder finder)
Create drive by loading it from local JCR node. |
protected |
JCRLocalGoogleDrive(GoogleUser user,
javax.jcr.Node driveNode,
org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviders,
org.exoplatform.clouddrive.jcr.NodeFinder finder)
Create newly connecting drive. |
| Method Summary | |
|---|---|
protected boolean |
checkAccessScope(org.exoplatform.clouddrive.CloudDriveAccessException cause)
Throw RefreshAccessException if currently coded scope doesn't match the one used by the drive
access tokens. |
protected org.exoplatform.clouddrive.CloudFileAPI |
createFileAPI()
|
protected org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive.ConnectCommand |
getConnectCommand()
|
String |
getState()
|
protected org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive.SyncCommand |
getSyncCommand()
|
GoogleUser |
getUser()
|
protected void |
initDrive(javax.jcr.Node driveNode)
|
protected boolean |
isAccessScopeMatch()
Check if currently coded scope match the one used by the drive access tokens. |
protected static GoogleUser |
loadUser(org.exoplatform.clouddrive.gdrive.GoogleDriveConnector.API apiBuilder,
GoogleProvider provider,
javax.jcr.Node driveNode)
Load user from the drive Node. |
protected List<com.google.api.services.drive.model.ParentReference> |
mergeParents(String parentId,
List<com.google.api.services.drive.model.ParentReference> cloudParents,
Collection<String> localParentIds)
Merge file's local and cloud parents (in case of move replace source on destination). |
void |
onUserTokenRefresh(org.exoplatform.clouddrive.oauth2.UserToken token)
|
protected Long |
readChangeId()
|
protected void |
refreshAccess()
|
protected void |
saveChangeId(Long id)
|
protected void |
updateAccess(org.exoplatform.clouddrive.CloudUser newUser)
|
| Methods inherited from class org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive |
|---|
addJCRListener, checkTrashed, cleanName, cleanNode, cleanRemoved, cleanup, cleanUpdated, commitChanges, configure, connect, copyNode, createIfNotCloudFile, disconnect, editLink, fileNode, findNode, findNodes, getChangeId, getConnectDate, getFile, getId, getInitDate, getLink, getLocalUser, getOrCleanFileNode, getPath, getTitle, hasFile, hasRemoved, hasUpdated, initCommon, initCopy, initFile, initFolder, initRemove, isConnected, isDrive, isDrive, isDrive, isSameDrive, listFiles, listFiles, listFiles, loadHistory, migrateName, moveFile, nextChangeId, openFile, openFolder, previewLink, readFile, readNode, readNodes, removeJCRListener, rollback, rootName, rootNode, rootTitle, saveChanges, savedChanges, session, setChangeId, synchronize, systemSession, title, tryCreateCloudFile |
| Methods inherited from class org.exoplatform.clouddrive.CloudDrive |
|---|
addListener, removeListener, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected JCRLocalGoogleDrive(GoogleUser user,
javax.jcr.Node driveNode,
org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviders,
org.exoplatform.clouddrive.jcr.NodeFinder finder)
throws org.exoplatform.clouddrive.CloudDriveException,
javax.jcr.RepositoryException
user - driveNode - sessionProviders -
org.exoplatform.clouddrive.CloudDriveException
javax.jcr.RepositoryException
protected JCRLocalGoogleDrive(org.exoplatform.clouddrive.gdrive.GoogleDriveConnector.API apiBuilder,
GoogleProvider provider,
javax.jcr.Node driveNode,
org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviders,
org.exoplatform.clouddrive.jcr.NodeFinder finder)
throws javax.jcr.RepositoryException,
GoogleDriveException,
org.exoplatform.clouddrive.CloudDriveException
apiBuilder - GoogleDriveConnector.API API builderprovider - GoogleProviderdriveNode - Node root of the drivesessionProviders -
javax.jcr.RepositoryException - if local storage error
org.exoplatform.clouddrive.CloudDriveException - if cannot load tokens stored locally
GoogleDriveException - if error communicating with Google Drive services| Method Detail |
|---|
protected static GoogleUser loadUser(org.exoplatform.clouddrive.gdrive.GoogleDriveConnector.API apiBuilder,
GoogleProvider provider,
javax.jcr.Node driveNode)
throws javax.jcr.RepositoryException,
GoogleDriveException,
org.exoplatform.clouddrive.CloudDriveException
apiBuilder - GoogleDriveConnector.API API builderprovider - GoogleProviderdriveNode - Node root of the drive
GoogleUser
javax.jcr.RepositoryException
GoogleDriveException
org.exoplatform.clouddrive.CloudDriveExceptionpublic GoogleUser getUser()
getUser in class org.exoplatform.clouddrive.CloudDrivepublic String getState()
getState in class org.exoplatform.clouddrive.CloudDrive
public void onUserTokenRefresh(org.exoplatform.clouddrive.oauth2.UserToken token)
throws org.exoplatform.clouddrive.CloudDriveException
onUserTokenRefresh in interface org.exoplatform.clouddrive.oauth2.UserTokenRefreshListenerorg.exoplatform.clouddrive.CloudDriveException
protected void refreshAccess()
throws GoogleDriveException
refreshAccess in class org.exoplatform.clouddrive.CloudDriveGoogleDriveException
protected void updateAccess(org.exoplatform.clouddrive.CloudUser newUser)
throws org.exoplatform.clouddrive.CloudDriveException,
javax.jcr.RepositoryException
updateAccess in class org.exoplatform.clouddrive.CloudDriveorg.exoplatform.clouddrive.CloudDriveException
javax.jcr.RepositoryException
protected boolean isAccessScopeMatch()
throws javax.jcr.RepositoryException,
org.exoplatform.clouddrive.DriveRemovedException
org.exoplatform.clouddrive.DriveRemovedException
javax.jcr.RepositoryException
protected boolean checkAccessScope(org.exoplatform.clouddrive.CloudDriveAccessException cause)
throws javax.jcr.RepositoryException,
org.exoplatform.clouddrive.RefreshAccessException,
org.exoplatform.clouddrive.DriveRemovedException
RefreshAccessException if currently coded scope doesn't match the one used by the drive
access tokens.
cause - CloudDriveAccessException
false if access coded and currently used access scopes match, otherwise
RefreshAccessException will be thrown with given cause CloudDriveAccessException
javax.jcr.RepositoryException
org.exoplatform.clouddrive.RefreshAccessException
org.exoplatform.clouddrive.DriveRemovedException
protected Long readChangeId()
throws javax.jcr.RepositoryException,
org.exoplatform.clouddrive.CloudDriveException
readChangeId in class org.exoplatform.clouddrive.jcr.JCRLocalCloudDrivejavax.jcr.RepositoryException
org.exoplatform.clouddrive.CloudDriveException
protected void saveChangeId(Long id)
throws org.exoplatform.clouddrive.CloudDriveException,
javax.jcr.RepositoryException
saveChangeId in class org.exoplatform.clouddrive.jcr.JCRLocalCloudDriveorg.exoplatform.clouddrive.CloudDriveException
javax.jcr.RepositoryException
protected void initDrive(javax.jcr.Node driveNode)
throws org.exoplatform.clouddrive.CloudDriveException,
javax.jcr.RepositoryException
initDrive in class org.exoplatform.clouddrive.jcr.JCRLocalCloudDriveorg.exoplatform.clouddrive.CloudDriveException
javax.jcr.RepositoryException
protected org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive.ConnectCommand getConnectCommand()
throws org.exoplatform.clouddrive.DriveRemovedException,
javax.jcr.RepositoryException
getConnectCommand in class org.exoplatform.clouddrive.jcr.JCRLocalCloudDriveorg.exoplatform.clouddrive.DriveRemovedException
javax.jcr.RepositoryException
protected org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive.SyncCommand getSyncCommand()
throws org.exoplatform.clouddrive.DriveRemovedException,
org.exoplatform.clouddrive.SyncNotSupportedException,
javax.jcr.RepositoryException
getSyncCommand in class org.exoplatform.clouddrive.jcr.JCRLocalCloudDriveorg.exoplatform.clouddrive.DriveRemovedException
org.exoplatform.clouddrive.SyncNotSupportedException
javax.jcr.RepositoryException
protected org.exoplatform.clouddrive.CloudFileAPI createFileAPI()
throws org.exoplatform.clouddrive.DriveRemovedException,
org.exoplatform.clouddrive.SyncNotSupportedException,
javax.jcr.RepositoryException
createFileAPI in class org.exoplatform.clouddrive.jcr.JCRLocalCloudDriveorg.exoplatform.clouddrive.DriveRemovedException
org.exoplatform.clouddrive.SyncNotSupportedException
javax.jcr.RepositoryException
protected List<com.google.api.services.drive.model.ParentReference> mergeParents(String parentId,
List<com.google.api.services.drive.model.ParentReference> cloudParents,
Collection<String> localParentIds)
parentId - String current local parent idcloudParents - List of ParentReference on cloud sidelocalParentIds - List of parent ids locally
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||