public class JCRLocalDropboxDrive
extends org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive
implements org.exoplatform.clouddrive.oauth2.UserTokenRefreshListener
| Modifier and Type | Class and Description |
|---|---|
protected static interface |
JCRLocalDropboxDrive.Changes
Applicable changes of local Drobpox drive.
|
protected class |
JCRLocalDropboxDrive.Connect
Connect algorithm for Drobpox drive.
|
protected class |
JCRLocalDropboxDrive.DeletedInfo
The Class DeletedInfo.
|
protected class |
JCRLocalDropboxDrive.DropboxDrive
The Class DropboxDrive.
|
class |
JCRLocalDropboxDrive.DropboxState
The Class DropboxState.
|
protected class |
JCRLocalDropboxDrive.EventsSync
An implementation of
SyncCommand based on an abstract deltas queue
proposed and maintained by the cloud service. |
protected class |
JCRLocalDropboxDrive.FileAPI
CloudFileAPI implementation for Dropbox synchronization. |
protected class |
JCRLocalDropboxDrive.FileInfo
The Class FileInfo.
|
protected class |
JCRLocalDropboxDrive.FolderInfo
The Class FolderInfo.
|
protected class |
JCRLocalDropboxDrive.ItemInfo
Dropbox item helper to extract info from its file/folder metadata object.
|
class |
JCRLocalDropboxDrive.JCRLocalDropboxFile
Deprecated.
|
protected class |
JCRLocalDropboxDrive.MetadataInfo
Dropbox item helper to extract info from its metadata object.
|
protected class |
JCRLocalDropboxDrive.MovedFile
The Class MovedFile.
|
protected class |
JCRLocalDropboxDrive.UnknownInfo
The Class UnknownInfo for not recognized changes.
|
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.SyncFilesCommand| Modifier and Type | Field and Description |
|---|---|
static String |
FOLDER_REV
The Constant FOLDER_REV.
|
static String |
FOLDER_TYPE
The Constant FOLDER_TYPE.
|
protected JCRLocalDropboxDrive.DropboxState |
state
Dropbox drive state.
|
accentsConverter, 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, rootSystemNodeHolder, rootUUID, rootWorkspace, sessionProviders, syncFilesMessages, syncLock, updating, user, USER_NODEPATH, USER_SESSIONPROVIDER, USER_WORKSPACE, workerExecutor| Modifier | Constructor and Description |
|---|---|
protected |
JCRLocalDropboxDrive(org.exoplatform.clouddrive.dropbox.DropboxConnector.API apiFactory,
DropboxProvider 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)
Instantiates a new JCR local dropbox drive.
|
protected |
JCRLocalDropboxDrive(DropboxUser 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)
Instantiates a new JCR local dropbox drive.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
cleanPath(String path)
Clean path from leading and ending slashes.
|
protected org.exoplatform.clouddrive.CloudFileAPI |
createFileAPI() |
protected String |
createSharedLink(javax.jcr.Node fileNode)
Creates the shared link.
|
protected void |
fetchItem(DropboxAPI api,
JCRLocalDropboxDrive.MetadataInfo item,
String parentId,
javax.jcr.Node parentNode,
Collection<org.exoplatform.clouddrive.utils.ChunkIterator<?>> iterators,
JCRLocalDropboxDrive.Changes changes)
Fetch remote item, for a folder do recursive.
|
protected org.exoplatform.clouddrive.dropbox.DropboxAPI.ListFolder |
fetchSubtree(DropboxAPI api,
String itemId,
javax.jcr.Node node,
Collection<org.exoplatform.clouddrive.utils.ChunkIterator<?>> iterators,
JCRLocalDropboxDrive.Changes changes)
Fetch subtree (children) of given item from remote side.
|
protected String |
findMimetype(String fileName)
Find mimetype.
|
protected void |
fixNameConflict(javax.jcr.Node file) |
protected String |
folderCursor(javax.jcr.Node node)
Folder cursor.
|
protected org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive.ConnectCommand |
getConnectCommand() |
protected String |
getDropboxPath(javax.jcr.Node localNode)
Get Dropbox path saved in local item.
|
org.exoplatform.clouddrive.viewer.ContentReader |
getFileContent(String idPath) |
org.exoplatform.clouddrive.CloudDrive.FilesState |
getState() |
protected org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive.SyncCommand |
getSyncCommand() |
DropboxUser |
getUser() |
protected boolean |
hasDifferentRev(javax.jcr.Node node,
JCRLocalDropboxDrive.FileInfo file)
Checks for different rev.
|
protected boolean |
hasLocationChanged(javax.jcr.Node node,
JCRLocalDropboxDrive.ItemInfo item)
Checks for location changed.
|
protected boolean |
hasSameId(javax.jcr.Node node,
JCRLocalDropboxDrive.ItemInfo item)
Checks for same ID of local node and remote item.
|
protected void |
initDrive(javax.jcr.Node driveNode) |
protected void |
initDropboxFile(javax.jcr.Node localNode,
String rev,
Long size)
Initialize Dropbox file.
|
protected void |
initDropboxFolder(javax.jcr.Node localNode,
String cursor)
Initialize Dropbox folder.
|
protected void |
initDropboxPath(javax.jcr.Node localNode,
String path)
Init Dropbox dbxPath of local item.
|
boolean |
isSharingSupported() |
protected JCRLocalDropboxDrive.MetadataInfo |
itemInfo(com.dropbox.core.v2.files.Metadata item)
Metadata info.
|
protected String |
link(javax.jcr.Node fileNode) |
protected static DropboxUser |
loadUser(org.exoplatform.clouddrive.dropbox.DropboxConnector.API apiFactory,
DropboxProvider provider,
javax.jcr.Node driveNode)
Load user from the drive Node.
|
protected String |
nodeName(String title) |
protected void |
normalizeName(javax.jcr.Node fileNode)
Ensure the Dropbox file node has name in lower-case.
|
void |
onUserTokenRefresh(org.exoplatform.clouddrive.oauth2.UserToken token) |
void |
onUserTokenRemove() |
protected String |
previewLink(String type,
javax.jcr.Node fileNode) |
protected Long |
readChangeId() |
protected void |
refreshAccess() |
protected void |
saveChangeId(Long id) |
void |
shareFile(javax.jcr.Node fileNode,
String... users) |
void |
unshareFile(javax.jcr.Node fileNode,
String... users) |
protected void |
updateAccess(org.exoplatform.clouddrive.CloudUser newUser) |
protected org.exoplatform.clouddrive.jcr.JCRLocalCloudFile |
updateItem(DropboxAPI api,
JCRLocalDropboxDrive.MetadataInfo update,
javax.jcr.Node parent,
javax.jcr.Node node)
Update, create or delete a local node of Cloud File.
|
protected void |
updateState(String cursor)
Update state.
|
addJCRListener, addUpdating, await, checkNotTrashed, cleanName, cleanRemoved, cleanup, cleanUpdated, commitChanges, configure, connect, copyFile, create, currentUserName, disconnect, editLink, ensureSame, fileNode, findNode, findNodes, getChangeId, getConnectDate, getCurentCommand, getFile, getFilePreview, getId, getInitDate, getLink, getLocalUser, getOrCleanFileNode, getPath, getTitle, getWorkspace, hasChange, hasFile, hasRemoved, hasUpdated, ignore, initCommon, initCopy, initFile, initFolder, initRemove, initUpdating, isConnected, isDrive, isDrive, isIgnored, isInDrive, isInTrash, isLocal, isNew, isNewOrUpdating, isPrivilegedUser, isSameDrive, isUpdating, listFiles, listFiles, loadHistory, localChange, migrateName, moveFile, nextChangeId, openFile, openFolder, parentPath, readFile, readNode, readNodes, removeJCRListener, removeLinks, removeLinks, removeNode, removeUpdating, rollback, rollbackAllChanges, rootNode, rootNode, saveChanges, savedChanges, session, setChangeId, size, synchronize, systemSession, thumbnailLink, title, unignorepublic static final String FOLDER_REV
public static final String FOLDER_TYPE
protected JCRLocalDropboxDrive.DropboxState state
getState().protected JCRLocalDropboxDrive(DropboxUser 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 JCRLocalDropboxDrive(org.exoplatform.clouddrive.dropbox.DropboxConnector.API apiFactory,
DropboxProvider 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,
org.exoplatform.clouddrive.CloudDriveException
apiFactory - the API factoryprovider - the providerdriveNode - the drive nodesessionProviders - the session providersfinder - the findermimeTypes - the mime typesjavax.jcr.RepositoryException - the repository exceptionorg.exoplatform.clouddrive.CloudDriveException - the cloud drive exceptionprotected 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 void updateState(String cursor)
cursor - the cursorprotected static DropboxUser loadUser(org.exoplatform.clouddrive.dropbox.DropboxConnector.API apiFactory, DropboxProvider provider, javax.jcr.Node driveNode) throws javax.jcr.RepositoryException, DropboxException, org.exoplatform.clouddrive.CloudDriveException
apiFactory - DropboxConnector.API API factoryprovider - DropboxProviderdriveNode - Node root of the driveDropboxUserjavax.jcr.RepositoryException - the repository exceptionDropboxException - the dropbox exceptionorg.exoplatform.clouddrive.CloudDriveException - the cloud drive exceptionpublic 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.CloudDriveExceptionpublic org.exoplatform.clouddrive.viewer.ContentReader getFileContent(String idPath) throws javax.jcr.RepositoryException, org.exoplatform.clouddrive.CloudDriveException
getFileContent in interface org.exoplatform.clouddrive.CloudDriveStoragegetFileContent in class org.exoplatform.clouddrive.jcr.JCRLocalCloudDrivejavax.jcr.RepositoryExceptionorg.exoplatform.clouddrive.CloudDriveExceptionpublic org.exoplatform.clouddrive.CloudDrive.FilesState getState()
throws org.exoplatform.clouddrive.DriveRemovedException,
org.exoplatform.clouddrive.RefreshAccessException,
org.exoplatform.clouddrive.CloudProviderException,
javax.jcr.RepositoryException
getState in class org.exoplatform.clouddrive.jcr.JCRLocalCloudDriveorg.exoplatform.clouddrive.DriveRemovedExceptionorg.exoplatform.clouddrive.RefreshAccessExceptionorg.exoplatform.clouddrive.CloudProviderExceptionjavax.jcr.RepositoryExceptionpublic boolean isSharingSupported()
isSharingSupported in interface org.exoplatform.clouddrive.CloudDriveSecurityisSharingSupported in class org.exoplatform.clouddrive.jcr.JCRLocalCloudDrivepublic void shareFile(javax.jcr.Node fileNode,
String... users)
throws javax.jcr.RepositoryException,
org.exoplatform.clouddrive.CloudDriveException
shareFile in interface org.exoplatform.clouddrive.CloudDriveSecurityshareFile in class org.exoplatform.clouddrive.jcr.JCRLocalCloudDrivejavax.jcr.RepositoryExceptionorg.exoplatform.clouddrive.CloudDriveExceptionpublic void unshareFile(javax.jcr.Node fileNode,
String... users)
throws javax.jcr.RepositoryException,
org.exoplatform.clouddrive.CloudDriveException
unshareFile in interface org.exoplatform.clouddrive.CloudDriveSecurityunshareFile in class org.exoplatform.clouddrive.jcr.JCRLocalCloudDrivejavax.jcr.RepositoryExceptionorg.exoplatform.clouddrive.CloudDriveExceptionprotected 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 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.RepositoryExceptionpublic DropboxUser getUser()
getUser in class org.exoplatform.clouddrive.CloudDriveprotected void refreshAccess()
throws org.exoplatform.clouddrive.CloudDriveException
refreshAccess in class org.exoplatform.clouddrive.CloudDriveorg.exoplatform.clouddrive.CloudDriveExceptionprotected 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 void fixNameConflict(javax.jcr.Node file)
throws javax.jcr.RepositoryException
fixNameConflict in class org.exoplatform.clouddrive.jcr.JCRLocalCloudDrivejavax.jcr.RepositoryExceptionprotected void normalizeName(javax.jcr.Node fileNode)
throws javax.jcr.RepositoryException
JCRLocalDropboxDrive.DropboxDrive work.fileNode - Nodejavax.jcr.RepositoryException - the repository exceptionprotected void initDropboxFile(javax.jcr.Node localNode,
String rev,
Long size)
throws javax.jcr.RepositoryException,
DropboxException
localNode - Noderev - the revsize - the sizejavax.jcr.RepositoryException - the repository exceptionDropboxException - the dropbox exceptionprotected void initDropboxFolder(javax.jcr.Node localNode,
String cursor)
throws javax.jcr.RepositoryException,
DropboxException
localNode - Nodecursor - String a cursor of last synchronization, if null
it will be ignoredjavax.jcr.RepositoryException - the repository exceptionDropboxException - the dropbox exceptionprotected void initDropboxPath(javax.jcr.Node localNode,
String path)
throws javax.jcr.RepositoryException
localNode - the local nodepath - the pathjavax.jcr.RepositoryException - the repository exceptionprotected String getDropboxPath(javax.jcr.Node localNode) throws javax.jcr.RepositoryException
null will be returned.localNode - the local nodenulljavax.jcr.RepositoryException - the repository exceptionprotected org.exoplatform.clouddrive.jcr.JCRLocalCloudFile updateItem(DropboxAPI api, JCRLocalDropboxDrive.MetadataInfo update, javax.jcr.Node parent, javax.jcr.Node node) throws javax.jcr.RepositoryException, org.exoplatform.clouddrive.CloudDriveException
null then it will be open on the given parent and created if
not already exists. If item metadata is not file or folder type, then
CloudDriveException will be thrown.api - DropboxAPIupdate - the updateparent - Node, can be null if node givennode - Node, can be null if parent givenJCRLocalCloudFilejavax.jcr.RepositoryException - for storage errorsorg.exoplatform.clouddrive.CloudDriveException - for drive or format errors, or if item metadata
not of existing file or folderprotected String createSharedLink(javax.jcr.Node fileNode) throws javax.jcr.RepositoryException, org.exoplatform.clouddrive.CloudDriveException
fileNode - the file nodejavax.jcr.RepositoryException - the repository exceptionorg.exoplatform.clouddrive.CloudDriveException - the cloud drive exceptionprotected String link(javax.jcr.Node fileNode) throws javax.jcr.RepositoryException
link in class org.exoplatform.clouddrive.jcr.JCRLocalCloudDrivejavax.jcr.RepositoryExceptionprotected String previewLink(String type, javax.jcr.Node fileNode) throws javax.jcr.RepositoryException
previewLink in class org.exoplatform.clouddrive.jcr.JCRLocalCloudDrivejavax.jcr.RepositoryExceptionprotected String findMimetype(String fileName)
fileName - the file nameprotected org.exoplatform.clouddrive.dropbox.DropboxAPI.ListFolder fetchSubtree(DropboxAPI api, String itemId, javax.jcr.Node node, Collection<org.exoplatform.clouddrive.utils.ChunkIterator<?>> iterators, JCRLocalDropboxDrive.Changes changes) throws javax.jcr.RepositoryException, org.exoplatform.clouddrive.CloudDriveException
api - the apiitemId - the item idnode - the nodeiterators - the iteratorschanges - the changesjavax.jcr.RepositoryException - the repository exceptionorg.exoplatform.clouddrive.CloudDriveException - the cloud drive exceptionprotected void fetchItem(DropboxAPI api, JCRLocalDropboxDrive.MetadataInfo item, String parentId, javax.jcr.Node parentNode, Collection<org.exoplatform.clouddrive.utils.ChunkIterator<?>> iterators, JCRLocalDropboxDrive.Changes changes) throws javax.jcr.RepositoryException, org.exoplatform.clouddrive.NotFoundException, org.exoplatform.clouddrive.CloudDriveException
api - the apiitem - the item metadataparentId - the parent IDparentNode - the parent nodeiterators - the iterators for progress tracking, can be
nullchanges - the changes command (e.g. connect, sync or restore), never
nulljavax.jcr.RepositoryException - the repository exceptionorg.exoplatform.clouddrive.NotFoundException - the not found exceptionorg.exoplatform.clouddrive.CloudDriveException - the cloud drive exceptionprotected String folderCursor(javax.jcr.Node node) throws javax.jcr.RepositoryException
node - the nodejavax.jcr.RepositoryException - the repository exceptionprotected String nodeName(String title)
nodeName in class org.exoplatform.clouddrive.jcr.JCRLocalCloudDriveprotected JCRLocalDropboxDrive.MetadataInfo itemInfo(com.dropbox.core.v2.files.Metadata item)
item - the itemprotected boolean hasLocationChanged(javax.jcr.Node node,
JCRLocalDropboxDrive.ItemInfo item)
throws javax.jcr.RepositoryException
node - the local item nodeitem - the remote itemjavax.jcr.RepositoryException - the repository exceptionprotected boolean hasSameId(javax.jcr.Node node,
JCRLocalDropboxDrive.ItemInfo item)
throws javax.jcr.RepositoryException
node - the nodeitem - the itemjavax.jcr.RepositoryException - the repository exceptionprotected boolean hasDifferentRev(javax.jcr.Node node,
JCRLocalDropboxDrive.FileInfo file)
throws javax.jcr.RepositoryException
node - the nodefile - the filejavax.jcr.RepositoryException - the repository exceptionCopyright © 2003–2020 eXo Platform SAS. All rights reserved.