|
||||||||||
| 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.cmis.JCRLocalCMISDrive
public class JCRLocalCMISDrive
Local drive for CMIS provider.
| Nested Class Summary | |
|---|---|
protected class |
JCRLocalCMISDrive.Connect
Connect algorithm for Template drive. |
protected class |
JCRLocalCMISDrive.DocumentContent
|
protected class |
JCRLocalCMISDrive.FileAPI
CloudFileAPI implementation. |
static interface |
JCRLocalCMISDrive.LocalFile
|
protected class |
JCRLocalCMISDrive.Sync
A facade SyncCommand implementation. |
| 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.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 |
| Nested classes/interfaces inherited from class org.exoplatform.clouddrive.CloudDrive |
|---|
org.exoplatform.clouddrive.CloudDrive.Command, org.exoplatform.clouddrive.CloudDrive.CommandProgress, org.exoplatform.clouddrive.CloudDrive.FilesState, org.exoplatform.clouddrive.CloudDrive.ListenerSupport |
| Field Summary | |
|---|---|
protected AtomicLong |
changeIdSequencer
|
protected String |
exoURL
Platform server host URL, used for preview URL generation. |
static long |
FULL_SYNC_PERIOD
Period to perform FullSync as a next sync request. |
| Fields inherited from class org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive |
|---|
accentsConverter, actionDrive, ALREADY_DONE, 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, noConnect, noSync, NT_FILE, NT_FOLDER, NT_RESOURCE, NT_UNSTRUCTURED, repository, rootNodeHolder, rootUUID, rootWorkspace, sessionProviders, state, syncFilesChanged, syncFilesMessages, syncLock, updating, user, USER_NODEPATH, USER_SESSIONPROVIDER, USER_WORKSPACE, workerExecutor |
| Fields inherited from class org.exoplatform.clouddrive.CloudDrive |
|---|
listeners, LOG |
| Constructor Summary | |
|---|---|
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)
|
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)
|
| Method Summary | |
|---|---|
protected String |
createContentLink(String path,
String fileId)
Create a link to get this file content via eXo REST service as a proxy to remote CMIS. |
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()
|
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(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. |
| Methods inherited from class org.exoplatform.clouddrive.jcr.JCRLocalCloudDrive |
|---|
addJCRListener, addUpdating, await, checkNotTrashed, cleanName, cleanNode, cleanRemoved, cleanup, cleanUpdated, commitChanges, configure, connect, copyNode, create, disconnect, editLink, fileNode, findNode, findNodes, getChangeId, getConnectDate, getCurentCommand, getFile, getId, getInitDate, getLink, getLocalUser, getOrCleanFileNode, getPath, getState, getTitle, hasFile, hasRemoved, hasUpdated, ignore, initCommon, initCopy, initDrive, initFolder, initRemove, initUpdating, isConnected, isDrive, isDrive, isIgnored, isInDrive, isInTrash, isLocal, isNew, isNewOrUpdating, isSameDrive, isUpdating, link, listFiles, listFiles, listFiles, loadHistory, migrateName, moveFile, nextChangeId, openFile, openFolder, readFile, readNode, removeJCRListener, removeUpdating, rollback, rollbackAllChanges, rollbackChanges, rootNode, saveChanges, savedChanges, session, setChangeId, size, synchronize, systemSession, thumbnailLink, title, unignore |
| 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 |
| Field Detail |
|---|
public static final long FULL_SYNC_PERIOD
FullSync as a next sync request. See implementation of
getSyncCommand().
protected final AtomicLong changeIdSequencer
protected final String exoURL
| Constructor Detail |
|---|
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 - driveNode - sessionProviders -
org.exoplatform.clouddrive.CloudDriveException
javax.jcr.RepositoryException
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)
throws javax.jcr.RepositoryException,
org.exoplatform.clouddrive.CloudDriveException
javax.jcr.RepositoryException
org.exoplatform.clouddrive.CloudDriveException| Method Detail |
|---|
protected 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 drive
CMISUser
javax.jcr.RepositoryException
CMISException
org.exoplatform.clouddrive.CloudDriveException
protected void saveAccess(javax.jcr.Node driveNode,
String password,
String serviceURL,
String repositoryId)
throws org.exoplatform.clouddrive.CloudDriveException
updateAccess(CloudUser).
driveNode - Stringpassword - StringserviceURL - String optional if it's access updaterepositoryId - String optional if it's access update
org.exoplatform.clouddrive.CloudDriveException
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.RefreshAccessException
org.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 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.RepositoryExceptionpublic CMISUser getUser()
getUser in class org.exoplatform.clouddrive.CloudDrive
protected void refreshAccess()
throws org.exoplatform.clouddrive.CloudDriveException
refreshAccess in class org.exoplatform.clouddrive.CloudDriveorg.exoplatform.clouddrive.CloudDriveException
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 void initCMISItem(javax.jcr.Node node,
org.apache.chemistry.opencmis.client.api.CmisObject item)
throws javax.jcr.RepositoryException,
CMISException
node - Nodeitem - CmisObject
javax.jcr.RepositoryException
CMISException
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)
throws javax.jcr.RepositoryException
initFile in class org.exoplatform.clouddrive.jcr.JCRLocalCloudDrivejavax.jcr.RepositoryException
protected void setChangeToken(javax.jcr.Node localNode,
String changeToken)
throws javax.jcr.RepositoryException,
CMISException
localNode - NodechangeToken - String
javax.jcr.RepositoryException
CMISException
protected String getChangeToken(javax.jcr.Node localNode)
throws javax.jcr.RepositoryException,
CMISException
localNode - Node
String
javax.jcr.RepositoryException
CMISException
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)
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 null
JCRLocalCloudFile
javax.jcr.RepositoryException - for storage errors
org.exoplatform.clouddrive.CloudDriveException - for drive or format errors
protected String createContentLink(String path,
String fileId)
throws org.exoplatform.clouddrive.DriveRemovedException,
javax.jcr.RepositoryException
path - StringfileId - String
String
org.exoplatform.clouddrive.DriveRemovedException
javax.jcr.RepositoryException
protected String previewLink(javax.jcr.Node fileNode)
throws javax.jcr.RepositoryException
previewLink in class org.exoplatform.clouddrive.jcr.JCRLocalCloudDrivejavax.jcr.RepositoryException
protected 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().
file - Document CMIS documentlocalType - String locally stored MIME type for given file or null
String relevant MIME type, not null
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()).
fileName - String file namefileType - String MIME type already associated with the given file
String relevant MIME type, not null
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()).
fileName - String file namefileType - String MIME type already associated with the given file namealternativeType - String alternative (locally stored) MIME type for given file name or
null
String relevant MIME type, not null
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.RepositoryException
org.exoplatform.clouddrive.CannotConnectDriveException
protected 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.RepositoryException
protected 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 drive
org.exoplatform.clouddrive.CloudDriveAccessException
org.exoplatform.clouddrive.NotFoundException
CMISException
org.exoplatform.clouddrive.UnauthorizedExceptionreadNodes(Node, Map, boolean)
public ContentReader getFileContent(String fileId)
throws CMISException,
org.exoplatform.clouddrive.NotFoundException,
org.exoplatform.clouddrive.CloudDriveAccessException,
org.exoplatform.clouddrive.DriveRemovedException,
javax.jcr.RepositoryException,
org.exoplatform.clouddrive.UnauthorizedException
CMISException
org.exoplatform.clouddrive.NotFoundException
org.exoplatform.clouddrive.CloudDriveAccessException
org.exoplatform.clouddrive.DriveRemovedException
javax.jcr.RepositoryException
org.exoplatform.clouddrive.UnauthorizedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||