public class JCRLocalCMISDrive
extends org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive
| Modifier and Type | Class and Description |
|---|---|
protected class |
JCRLocalCMISDrive.Connect
Connect algorithm for Template drive.
|
protected class |
JCRLocalCMISDrive.DocumentContent
The Class DocumentContent.
|
protected class |
JCRLocalCMISDrive.FileAPI
CloudFileAPI implementation. |
static interface |
JCRLocalCMISDrive.LocalFile
The Interface LocalFile.
|
protected class |
JCRLocalCMISDrive.Sync
A facade
SyncCommand implementation. |
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 |
|---|---|
protected AtomicLong |
changeIdSequencer
The change id sequencer.
|
protected String |
exoURL
Platform server host URL, used for preview URL generation.
|
static long |
FULL_SYNC_PERIOD
Period to perform
JCRLocalCMISDrive.Sync as a next sync request. |
protected static String |
PREVIOUS_LOCAL_NAME
The Constant PREVIOUS_LOCAL_NAME.
|
protected static String |
PREVIOUS_LOCAL_PARENT
The Constant PREVIOUS_LOCAL_PARENT.
|
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, state, syncFilesMessages, syncLock, updating, user, USER_NODEPATH, USER_SESSIONPROVIDER, USER_WORKSPACE, workerExecutor| Modifier | Constructor and Description |
|---|---|
protected |
JCRLocalCMISDrive(CMISConnector.API apiBuilder,
javax.jcr.Node driveNode,
org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviders,
org.exoplatform.clouddrive.jcr.NodeFinder finder,
org.exoplatform.clouddrive.utils.ExtendedMimeTypeResolver mimeTypes,
String exoURL)
Instantiates a new JCR local CMIS drive.
|
protected |
JCRLocalCMISDrive(CMISUser 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,
String exoURL)
Instantiates a new JCR local CMIS drive.
|
| Modifier and Type | Method and Description |
|---|---|
protected org.exoplatform.clouddrive.CloudFileAPI |
createFileAPI() |
protected void |
ensureSame(org.exoplatform.clouddrive.CloudUser user,
javax.jcr.Node driveNode) |
protected List<javax.jcr.Node> |
findDocumentNode(String id,
org.apache.chemistry.opencmis.client.api.CmisObject file,
Map<String,List<javax.jcr.Node>> nodes)
Find a node(s) representing a CMIS object with given ID.
|
protected String |
findMimetype(org.apache.chemistry.opencmis.client.api.Document file,
String localType)
Find MIME type of given CMIS document.
|
protected String |
findMimetype(String fileName,
String fileType)
Determine a MIME type of given file name if given file type is
null or a default value as defined by
ExtendedMimeTypeResolver.getDefaultMimeType(). |
protected String |
findMimetype(String fileName,
String fileType,
String alternativeType)
Determine a MIME type for given file name if given file type is
null or a default value as defined by
ExtendedMimeTypeResolver.getDefaultMimeType(). |
protected String |
getChangeToken(javax.jcr.Node localNode)
Read CMIS change token of a file.
Override this method to apply vendor specific logic (id type etc). |
protected org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive.ConnectCommand |
getConnectCommand() |
org.exoplatform.clouddrive.viewer.ContentReader |
getFileContent(String fileId) |
protected org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive.SyncCommand |
getSyncCommand() |
CMISUser |
getUser() |
protected void |
initCMISItem(javax.jcr.Node node,
org.apache.chemistry.opencmis.client.api.CmisObject item)
Initialize CMIS specifics of files and folders.
|
protected void |
initFile(javax.jcr.Node localNode,
String title,
String id,
String type,
String link,
String previewLink,
String thumbnailLink,
String author,
String lastUser,
Calendar created,
Calendar modified,
long size) |
protected static CMISUser |
loadUser(CMISConnector.API apiBuilder,
javax.jcr.Node driveNode)
Load user from the drive Node.
|
protected String |
previewLink(String type,
javax.jcr.Node fileNode) |
protected Long |
readChangeId() |
protected void |
readNodes(javax.jcr.Node parent,
Map<String,List<javax.jcr.Node>> nodes,
boolean deep) |
protected void |
refreshAccess() |
protected void |
saveAccess(javax.jcr.Node driveNode,
String password,
String serviceURL,
String repositoryId)
Save user credentials in local drive.
|
protected void |
saveChangeId(Long id) |
protected void |
setChangeToken(javax.jcr.Node localNode,
String changeToken)
Initialize CMIS Change Token of a file.
Override this method to apply vendor specific logic (id type etc). |
protected void |
updateAccess(org.exoplatform.clouddrive.CloudUser newUser) |
protected org.exoplatform.clouddrive.jcr.JCRLocalCloudFile |
updateItem(CMISAPI api,
org.apache.chemistry.opencmis.client.api.CmisObject item,
javax.jcr.Node parent,
javax.jcr.Node node)
Update or create a local node of Cloud File.
|
addJCRListener, addUpdating, await, checkNotTrashed, cleanName, cleanRemoved, cleanup, cleanUpdated, commitChanges, configure, connect, copyFile, create, currentUserName, disconnect, editLink, fileNode, findNode, findNodes, fixNameConflict, getChangeId, getConnectDate, getCurentCommand, getFile, getFilePreview, getId, getInitDate, getLink, getLocalUser, getOrCleanFileNode, getPath, getState, getTitle, getWorkspace, hasChange, hasFile, hasRemoved, hasUpdated, ignore, initCommon, initCopy, initDrive, initFolder, initRemove, initUpdating, isConnected, isDrive, isDrive, isIgnored, isInDrive, isInTrash, isLocal, isNew, isNewOrUpdating, isPrivilegedUser, isSameDrive, isSharingSupported, isUpdating, link, listFiles, listFiles, loadHistory, localChange, migrateName, moveFile, nextChangeId, nodeName, openFile, openFolder, parentPath, readFile, readNode, removeJCRListener, removeLinks, removeLinks, removeNode, removeUpdating, rollback, rollbackAllChanges, rootNode, rootNode, saveChanges, savedChanges, session, setChangeId, shareFile, size, synchronize, systemSession, thumbnailLink, title, unignore, unshareFilepublic static final long FULL_SYNC_PERIOD
JCRLocalCMISDrive.Sync as a next sync request. See implementation
of getSyncCommand().protected static final String PREVIOUS_LOCAL_NAME
protected static final String PREVIOUS_LOCAL_PARENT
protected final AtomicLong changeIdSequencer
protected final String exoURL
protected JCRLocalCMISDrive(CMISUser 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, String exoURL) throws org.exoplatform.clouddrive.CloudDriveException, javax.jcr.RepositoryException
user - the userdriveNode - the drive nodesessionProviders - the session providersfinder - the findermimeTypes - the mime typesexoURL - the exo URLorg.exoplatform.clouddrive.CloudDriveException - the cloud drive exceptionjavax.jcr.RepositoryException - the repository exceptionprotected JCRLocalCMISDrive(CMISConnector.API apiBuilder, javax.jcr.Node driveNode, org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviders, org.exoplatform.clouddrive.jcr.NodeFinder finder, org.exoplatform.clouddrive.utils.ExtendedMimeTypeResolver mimeTypes, String exoURL) throws javax.jcr.RepositoryException, org.exoplatform.clouddrive.CloudDriveException
apiBuilder - the api builderdriveNode - the drive nodesessionProviders - the session providersfinder - the findermimeTypes - the mime typesexoURL - the exo URLjavax.jcr.RepositoryException - the repository exceptionorg.exoplatform.clouddrive.CloudDriveException - the cloud drive exceptionprotected static CMISUser loadUser(CMISConnector.API apiBuilder, javax.jcr.Node driveNode) throws javax.jcr.RepositoryException, CMISException, org.exoplatform.clouddrive.CloudDriveException
apiBuilder - CMISConnector.API API builderdriveNode - Node root of the driveCMISUserjavax.jcr.RepositoryException - the repository exceptionCMISException - the CMIS exceptionorg.exoplatform.clouddrive.CloudDriveException - the cloud drive exceptionprotected void saveAccess(javax.jcr.Node driveNode,
String password,
String serviceURL,
String repositoryId)
throws org.exoplatform.clouddrive.CloudDriveException
updateAccess(CloudUser).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.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 CMISUser 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 initCMISItem(javax.jcr.Node node,
org.apache.chemistry.opencmis.client.api.CmisObject item)
throws javax.jcr.RepositoryException,
CMISException
node - Nodeitem - CmisObjectjavax.jcr.RepositoryException - the repository exceptionCMISException - the CMIS exceptionprotected void initFile(javax.jcr.Node localNode,
String title,
String id,
String type,
String link,
String previewLink,
String thumbnailLink,
String author,
String lastUser,
Calendar created,
Calendar modified,
long size)
throws javax.jcr.RepositoryException
initFile in class org.exoplatform.clouddrive.jcr.JCRLocalCloudDrivejavax.jcr.RepositoryExceptionprotected void setChangeToken(javax.jcr.Node localNode,
String changeToken)
throws javax.jcr.RepositoryException,
CMISException
localNode - NodechangeToken - Stringjavax.jcr.RepositoryException - the repository exceptionCMISException - the CMIS exceptionprotected String getChangeToken(javax.jcr.Node localNode) throws javax.jcr.RepositoryException, CMISException
localNode - NodeStringjavax.jcr.RepositoryException - the repository exceptionCMISException - the CMIS exceptionprotected org.exoplatform.clouddrive.jcr.JCRLocalCloudFile updateItem(CMISAPI api, org.apache.chemistry.opencmis.client.api.CmisObject item, 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 - CMISAPIitem - CmisObjectparent - Nodenode - Node, can be nullJCRLocalCloudFilejavax.jcr.RepositoryException - for storage errorsorg.exoplatform.clouddrive.CloudDriveException - for drive or format errorsprotected String previewLink(String type, javax.jcr.Node fileNode) throws javax.jcr.RepositoryException
previewLink in class org.exoplatform.clouddrive.jcr.JCRLocalCloudDrivejavax.jcr.RepositoryExceptionprotected String findMimetype(org.apache.chemistry.opencmis.client.api.Document file, String localType)
null or a default value as defined by
ExtendedMimeTypeResolver.getDefaultMimeType(), then most relevant
type will be determined and if nothing found an existing local type will be
returned. Otherwise a default type will be returned as defined by
ExtendedMimeTypeResolver.getDefaultMimeType().protected String findMimetype(String fileName, String fileType)
null or a default value as defined by
ExtendedMimeTypeResolver.getDefaultMimeType(). If required, a MIME
type will be guessed by
ExtendedMimeTypeResolver.getMimeType(String) and returned if found.
Otherwise a default type will be returned (
ExtendedMimeTypeResolver.getDefaultMimeType()).protected String findMimetype(String fileName, String fileType, String alternativeType)
null or a default value as defined by
ExtendedMimeTypeResolver.getDefaultMimeType(). Otherwise this
method returns the given file type.ExtendedMimeTypeResolver.getMimeType(String) and returned if found.
If not, and given alternative type not null, the alternative
type will be returned. Otherwise a default type will be returned (
ExtendedMimeTypeResolver.getDefaultMimeType()).protected void ensureSame(org.exoplatform.clouddrive.CloudUser user,
javax.jcr.Node driveNode)
throws javax.jcr.RepositoryException,
org.exoplatform.clouddrive.CannotConnectDriveException
ensureSame in class org.exoplatform.clouddrive.jcr.JCRLocalCloudDrivejavax.jcr.RepositoryExceptionorg.exoplatform.clouddrive.CannotConnectDriveExceptionprotected void readNodes(javax.jcr.Node parent,
Map<String,List<javax.jcr.Node>> nodes,
boolean deep)
throws javax.jcr.RepositoryException
readNodes in class org.exoplatform.clouddrive.jcr.JCRLocalCloudDrivejavax.jcr.RepositoryExceptionprotected List<javax.jcr.Node> findDocumentNode(String id, org.apache.chemistry.opencmis.client.api.CmisObject file, Map<String,List<javax.jcr.Node>> nodes) throws org.exoplatform.clouddrive.CloudDriveAccessException, CMISException, org.exoplatform.clouddrive.UnauthorizedException
id - Stringfile - CmisObject remote file objectnodes - list of existing locally files' nodes in the cloud driveorg.exoplatform.clouddrive.CloudDriveAccessException - the cloud drive access exceptionCMISException - the CMIS exceptionorg.exoplatform.clouddrive.UnauthorizedException - the unauthorized exceptionreadNodes(Node, Map, boolean)public org.exoplatform.clouddrive.viewer.ContentReader getFileContent(String fileId) throws org.exoplatform.clouddrive.CloudDriveException, org.exoplatform.clouddrive.NotFoundException, org.exoplatform.clouddrive.CloudDriveAccessException, org.exoplatform.clouddrive.DriveRemovedException, org.exoplatform.clouddrive.UnauthorizedException, javax.jcr.RepositoryException
getFileContent in interface org.exoplatform.clouddrive.CloudDriveStoragegetFileContent in class org.exoplatform.clouddrive.jcr.JCRLocalCloudDriveorg.exoplatform.clouddrive.CloudDriveExceptionorg.exoplatform.clouddrive.NotFoundExceptionorg.exoplatform.clouddrive.CloudDriveAccessExceptionorg.exoplatform.clouddrive.DriveRemovedExceptionorg.exoplatform.clouddrive.UnauthorizedExceptionjavax.jcr.RepositoryExceptionCopyright © 2003–2019 eXo Platform SAS. All rights reserved.