public class JCRLocalGoogleDrive
extends org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive
implements org.exoplatform.clouddrive.oauth2.UserTokenRefreshListener
| Modifier and Type | Class and Description |
|---|---|
protected class |
JCRLocalGoogleDrive.Connect
Connect algorithm for Google Drive.
|
protected class |
JCRLocalGoogleDrive.FileAPI
The Class FileAPI.
|
protected class |
JCRLocalGoogleDrive.Sync
Sync algorithm for Google Drive.
|
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.DriveState, 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.SyncFilesCommandaccentsConverter, actionDrive, ALREADY_DONE, COMMAND_CHANGES_CHUNK, commandEnv, CURRENT_LOCALFORMAT, currentChangeId, currentConnect, currentSync, delayedSyncFiles, driveCommands, 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, mimeTypes, MIX_REFERENCEABLE, MIX_VERSIONABLE, noConnect, noSync, NT_FILE, NT_FOLDER, NT_RESOURCE, NT_UNSTRUCTURED, repository, rootNodeHolder, rootUUID, rootWorkspace, sessionProviders, state, syncFilesMessages, syncLock, updating, user, USER_NODEPATH, USER_SESSIONPROVIDER, USER_WORKSPACE, workerExecutor| Modifier | Constructor and Description |
|---|---|
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,
org.exoplatform.clouddrive.utils.ExtendedMimeTypeResolver mimeTypes)
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,
org.exoplatform.clouddrive.utils.ExtendedMimeTypeResolver mimeTypes)
Create newly connecting drive.
|
| Modifier and Type | Method and Description |
|---|---|
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 String |
editLink(String fileLink,
String type,
javax.jcr.Node fileNode) |
protected long |
fileSize(com.google.api.services.drive.model.File gf)
Google Drive manages consumed size differently for uploaded (stored in
content) and native documents.
|
protected org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive.ConnectCommand |
getConnectCommand() |
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 boolean |
isEditableType(String mimeType)
Checks if is editable type of file type.
|
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 (local changes has precedence).
|
void |
onUserTokenRefresh(org.exoplatform.clouddrive.oauth2.UserToken token) |
void |
onUserTokenRemove() |
protected Long |
readChangeId() |
protected void |
refreshAccess() |
protected void |
saveChangeId(Long id) |
protected void |
updateAccess(org.exoplatform.clouddrive.CloudUser newUser) |
addJCRListener, addUpdating, await, checkNotTrashed, cleanName, cleanRemoved, cleanup, cleanUpdated, commitChanges, configure, connect, copyFile, create, currentUserName, disconnect, ensureSame, fileNode, findNode, findNodes, fixNameConflict, getChangeId, getConnectDate, getCurentCommand, getFile, getFileContent, getFilePreview, getId, getInitDate, getLink, getLocalUser, getOrCleanFileNode, getPath, getState, getTitle, getWorkspace, hasChange, hasFile, hasRemoved, hasUpdated, ignore, initCommon, initCopy, initFile, initFolder, initRemove, initUpdating, isConnected, isDrive, isDrive, isIgnored, isInDrive, isInTrash, isLocal, isNew, isNewOrUpdating, isSameDrive, isSharingSupported, isUpdating, link, listFiles, listFiles, loadHistory, localChange, migrateName, moveFile, nextChangeId, nodeName, openFile, openFolder, parentPath, previewLink, readFile, readNode, readNodes, removeJCRListener, removeLinks, removeLinks, removeNode, removeUpdating, rollback, rollbackAllChanges, rootNode, rootNode, saveChanges, savedChanges, session, setChangeId, shareFile, size, synchronize, systemSession, thumbnailLink, title, unignore, unshareFileprotected JCRLocalGoogleDrive(GoogleUser user, javax.jcr.Node driveNode, org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviders, org.exoplatform.clouddrive.jcr.NodeFinder finder, org.exoplatform.clouddrive.utils.ExtendedMimeTypeResolver mimeTypes) throws org.exoplatform.clouddrive.CloudDriveException, javax.jcr.RepositoryException
user - the userdriveNode - the drive nodesessionProviders - the session providersfinder - the findermimeTypes - the mime typesorg.exoplatform.clouddrive.CloudDriveException - the cloud drive exceptionjavax.jcr.RepositoryException - the repository exceptionprotected 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,
org.exoplatform.clouddrive.utils.ExtendedMimeTypeResolver mimeTypes)
throws javax.jcr.RepositoryException,
GoogleDriveException,
org.exoplatform.clouddrive.CloudDriveException
apiBuilder - GoogleDriveConnector.API API builderprovider - GoogleProviderdriveNode - Node root of the drivesessionProviders - the session providersfinder - the findermimeTypes - the mime typesjavax.jcr.RepositoryException - if local storage errorGoogleDriveException - if error communicating with Google Drive
servicesorg.exoplatform.clouddrive.CloudDriveException - if cannot load tokens stored locallyprotected 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 driveGoogleUserjavax.jcr.RepositoryException - the repository exceptionGoogleDriveException - the google drive exceptionorg.exoplatform.clouddrive.CloudDriveException - the cloud drive exceptionpublic GoogleUser getUser()
getUser in class org.exoplatform.clouddrive.CloudDrivepublic void onUserTokenRefresh(org.exoplatform.clouddrive.oauth2.UserToken token)
throws org.exoplatform.clouddrive.CloudDriveException
onUserTokenRefresh in interface org.exoplatform.clouddrive.oauth2.UserTokenRefreshListenerorg.exoplatform.clouddrive.CloudDriveExceptionpublic void onUserTokenRemove()
throws org.exoplatform.clouddrive.CloudDriveException
onUserTokenRemove in interface org.exoplatform.clouddrive.oauth2.UserTokenRefreshListenerorg.exoplatform.clouddrive.CloudDriveExceptionprotected void refreshAccess()
throws GoogleDriveException
refreshAccess in class org.exoplatform.clouddrive.CloudDriveGoogleDriveExceptionprotected void updateAccess(org.exoplatform.clouddrive.CloudUser newUser)
throws org.exoplatform.clouddrive.CloudDriveException,
javax.jcr.RepositoryException
updateAccess in class org.exoplatform.clouddrive.CloudDriveorg.exoplatform.clouddrive.CloudDriveExceptionjavax.jcr.RepositoryExceptionprotected boolean isAccessScopeMatch()
throws javax.jcr.RepositoryException,
org.exoplatform.clouddrive.DriveRemovedException
javax.jcr.RepositoryException - the repository exceptionorg.exoplatform.clouddrive.DriveRemovedException - the drive removed exceptionprotected 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 - CloudDriveAccessExceptionfalse if access coded and currently used access scopes
match, otherwise RefreshAccessException will be thrown with
given cause CloudDriveAccessExceptionjavax.jcr.RepositoryException - the repository exceptionorg.exoplatform.clouddrive.RefreshAccessException - the refresh access exceptionorg.exoplatform.clouddrive.DriveRemovedException - the drive removed exceptionprotected Long readChangeId() throws javax.jcr.RepositoryException, org.exoplatform.clouddrive.CloudDriveException
readChangeId in class org.exoplatform.clouddrive.jcr.JCRLocalCloudDrivejavax.jcr.RepositoryExceptionorg.exoplatform.clouddrive.CloudDriveExceptionprotected void saveChangeId(Long id) throws org.exoplatform.clouddrive.CloudDriveException, javax.jcr.RepositoryException
saveChangeId in class org.exoplatform.clouddrive.jcr.JCRLocalCloudDriveorg.exoplatform.clouddrive.CloudDriveExceptionjavax.jcr.RepositoryExceptionprotected void initDrive(javax.jcr.Node driveNode)
throws org.exoplatform.clouddrive.CloudDriveException,
javax.jcr.RepositoryException
initDrive in class org.exoplatform.clouddrive.jcr.JCRLocalCloudDriveorg.exoplatform.clouddrive.CloudDriveExceptionjavax.jcr.RepositoryExceptionprotected 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.DriveRemovedExceptionjavax.jcr.RepositoryExceptionprotected 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.DriveRemovedExceptionorg.exoplatform.clouddrive.SyncNotSupportedExceptionjavax.jcr.RepositoryExceptionprotected 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.DriveRemovedExceptionorg.exoplatform.clouddrive.SyncNotSupportedExceptionjavax.jcr.RepositoryExceptionprotected List<com.google.api.services.drive.model.ParentReference> mergeParents(String parentId, List<com.google.api.services.drive.model.ParentReference> cloudParents, Collection<String> localParentIds)
protected String editLink(String fileLink, String type, javax.jcr.Node fileNode) throws javax.jcr.RepositoryException
editLink in class org.exoplatform.clouddrive.jcr.JCRLocalCloudDrivejavax.jcr.RepositoryExceptionprotected long fileSize(com.google.api.services.drive.model.File gf)
gf - Fileprotected boolean isEditableType(String mimeType)
mimeType - the mime typeCopyright © 2003–2018 eXo Platform SAS. All rights reserved.