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.DbxFileInfo
Dropbox file info (path as ID, name and parent path) extracted from its original path in Dropbox.
|
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. |
protected class |
JCRLocalDropboxDrive.FullSync
Deprecated.
|
protected class |
JCRLocalDropboxDrive.MovedFile
The Class MovedFile.
|
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 long |
DEFAULT_LINK_EXPIRATION_PERIOD
Time to expire for file links obtained from Dropbox without explicitly set expiration time.
|
static String |
FOLDER_REV
The Constant FOLDER_REV.
|
static String |
FOLDER_TYPE
The Constant FOLDER_TYPE.
|
protected Map<String,JCRLocalDropboxDrive.MovedFile> |
moved
Moved files with expiration on each sync run.
|
protected JCRLocalDropboxDrive.DropboxState |
state
Dropbox drive state.
|
accentsConverter, actionDrive, ALREADY_DONE, COMMAND_CHANGES_CHUNK, commandEnv, CURRENT_LOCALFORMAT, currentChangeId, currentConnect, currentSync, 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, syncFilesMessages, syncLock, updating, user, USER_NODEPATH, USER_SESSIONPROVIDER, USER_WORKSPACE, workerExecutor| Modifier | Constructor and Description |
|---|---|
protected |
JCRLocalDropboxDrive(org.exoplatform.clouddrive.dropbox.DropboxConnector.API apiBuilder,
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 void |
cleanExpiredMoved()
Clean expired moved.
|
protected org.exoplatform.clouddrive.CloudFileAPI |
createFileAPI() |
protected String |
createSharedLink(javax.jcr.Node fileNode)
Creates the shared link.
|
protected com.dropbox.core.DbxEntry |
fetchSubtree(DropboxAPI api,
String idPath,
javax.jcr.Node node,
boolean useHash,
Collection<org.exoplatform.clouddrive.utils.ChunkIterator<?>> iterators,
JCRLocalDropboxDrive.Changes changes)
Fetch subtree.
|
protected String |
findMimetype(String fileName)
Find mimetype.
|
protected String |
folderHash(javax.jcr.Node node)
Folder hash.
|
protected org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive.ConnectCommand |
getConnectCommand() |
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 String |
idPath(String dbxPath)
Return Dropbox path in guaranteed lower case.
|
protected void |
initCloudItem(javax.jcr.Node localNode,
Object item)
Deprecated.
|
protected void |
initDrive(javax.jcr.Node driveNode) |
protected void |
initDropboxCommon(javax.jcr.Node localNode,
Boolean mightHaveThumbnail,
String iconName)
Initialize Dropbox entry (commons for file and folder).
|
protected void |
initDropboxFile(javax.jcr.Node localNode,
Boolean mightHaveThumbnail,
String iconName,
String rev,
Long size)
Initialize Dropbox file.
|
protected void |
initDropboxFolder(javax.jcr.Node localNode,
Boolean mightHaveThumbnail,
String iconName,
String deltaHash)
Initialize Dropbox folder.
|
boolean |
isSharingSupported() |
protected String |
link(javax.jcr.Node fileNode) |
protected static DropboxUser |
loadUser(org.exoplatform.clouddrive.dropbox.DropboxConnector.API apiBuilder,
DropboxProvider provider,
javax.jcr.Node driveNode)
Load user from the drive Node.
|
protected String |
nodeName(String title) |
protected javax.jcr.Node |
normalizeName(javax.jcr.Node fileNode)
Ensure the cloud file node has name in lower-case.
|
protected boolean |
notInRange(String path,
Collection<String> range)
Not in range.
|
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 com.dropbox.core.DbxEntry |
restoreSubtree(DropboxAPI api,
String idPath,
javax.jcr.Node node)
Restore subtree.
|
protected void |
saveChangeId(Long id) |
void |
shareFile(javax.jcr.Node fileNode,
String... users) |
protected void |
updateAccess(org.exoplatform.clouddrive.CloudUser newUser) |
protected org.exoplatform.clouddrive.jcr.JCRLocalCloudFile |
updateItem(DropboxAPI api,
JCRLocalDropboxDrive.DbxFileInfo file,
com.dropbox.core.DbxEntry metadata,
javax.jcr.Node parent,
javax.jcr.Node node)
Update or create a local node of Cloud File.
|
protected void |
updateState(String cursor)
Update state.
|
addJCRListener, addUpdating, await, checkNotTrashed, cleanName, cleanRemoved, cleanup, cleanUpdated, commitChanges, configure, connect, copyNode, 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, isSameDrive, isUpdating, listFiles, listFiles, loadHistory, localChange, migrateName, moveFile, nextChangeId, openFile, openFolder, readFile, readNode, readNodes, removeJCRListener, removeUpdating, rollback, rollbackAllChanges, rootNode, rootNode, saveChanges, savedChanges, session, setChangeId, size, synchronize, systemSession, thumbnailLink, title, unignorepublic static final long DEFAULT_LINK_EXPIRATION_PERIOD
public static final String FOLDER_REV
public static final String FOLDER_TYPE
protected JCRLocalDropboxDrive.DropboxState state
getState().protected Map<String,JCRLocalDropboxDrive.MovedFile> moved
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 apiBuilder,
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
apiBuilder - the api builderprovider - 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 apiBuilder, DropboxProvider provider, javax.jcr.Node driveNode) throws javax.jcr.RepositoryException, DropboxException, org.exoplatform.clouddrive.CloudDriveException
apiBuilder - DropboxConnector.API API builderprovider - 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.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.RepositoryException@Deprecated protected void initCloudItem(javax.jcr.Node localNode, Object item) throws javax.jcr.RepositoryException, DropboxException
localNode - Nodeitem - Objectjavax.jcr.RepositoryException - the repository exceptionDropboxException - the dropbox exceptionprotected void initDropboxFile(javax.jcr.Node localNode,
Boolean mightHaveThumbnail,
String iconName,
String rev,
Long size)
throws javax.jcr.RepositoryException,
DropboxException
localNode - NodemightHaveThumbnail - the might have thumbnailiconName - the icon namerev - the revsize - the sizejavax.jcr.RepositoryException - the repository exceptionDropboxException - the dropbox exceptionprotected void initDropboxFolder(javax.jcr.Node localNode,
Boolean mightHaveThumbnail,
String iconName,
String deltaHash)
throws javax.jcr.RepositoryException,
DropboxException
localNode - NodemightHaveThumbnail - BooleaniconName - StringdeltaHash - String a hash of last Delta synchronization, if null it will be ignoredjavax.jcr.RepositoryException - the repository exceptionDropboxException - the dropbox exceptionprotected void initDropboxCommon(javax.jcr.Node localNode,
Boolean mightHaveThumbnail,
String iconName)
throws javax.jcr.RepositoryException,
DropboxException
localNode - NodemightHaveThumbnail - BooleaniconName - Stringjavax.jcr.RepositoryException - the repository exceptionDropboxException - the dropbox exceptionprotected org.exoplatform.clouddrive.jcr.JCRLocalCloudFile updateItem(DropboxAPI api, JCRLocalDropboxDrive.DbxFileInfo file, com.dropbox.core.DbxEntry metadata, 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.api - DropboxAPIfile - JCRLocalDropboxDrive.DbxFileInfometadata - DbxEntryparent - Nodenode - Node, can be nullJCRLocalCloudFilejavax.jcr.RepositoryException - for storage errorsorg.exoplatform.clouddrive.CloudDriveException - for drive or format errorsprotected 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 boolean notInRange(String path, Collection<String> range)
path - the pathrange - the rangeprotected String findMimetype(String fileName)
fileName - the file nameprotected com.dropbox.core.DbxEntry restoreSubtree(DropboxAPI api, String idPath, javax.jcr.Node node) throws org.exoplatform.clouddrive.CloudDriveException, javax.jcr.RepositoryException
api - the apiidPath - the id pathnode - the nodeorg.exoplatform.clouddrive.CloudDriveException - the cloud drive exceptionjavax.jcr.RepositoryException - the repository exceptionprotected com.dropbox.core.DbxEntry fetchSubtree(DropboxAPI api, String idPath, javax.jcr.Node node, boolean useHash, Collection<org.exoplatform.clouddrive.utils.ChunkIterator<?>> iterators, JCRLocalDropboxDrive.Changes changes) throws org.exoplatform.clouddrive.CloudDriveException, javax.jcr.RepositoryException
api - the apiidPath - the id pathnode - the nodeuseHash - the use hashiterators - the iteratorschanges - the changesorg.exoplatform.clouddrive.CloudDriveException - the cloud drive exceptionjavax.jcr.RepositoryException - the repository exceptionprotected String folderHash(javax.jcr.Node node) throws javax.jcr.RepositoryException
node - the nodejavax.jcr.RepositoryException - the repository exceptionprotected void cleanExpiredMoved()
protected String nodeName(String title)
nodeName in class org.exoplatform.clouddrive.jcr.JCRLocalCloudDriveprotected javax.jcr.Node normalizeName(javax.jcr.Node fileNode)
throws javax.jcr.RepositoryException
fileNode - NodeNode the same as given or renamed to lower-case name.javax.jcr.RepositoryException - the repository exceptionCopyright © 2003–2017 eXo Platform SAS. All rights reserved.