Class CMISAPI


  • public class CMISAPI
    extends Object
    All calls to CMIS API here.
    • Field Detail

      • LOG

        protected static final org.exoplatform.services.log.Log LOG
        The Constant LOG.
      • OBJECT_PAGE_SIZE

        public static final int OBJECT_PAGE_SIZE
        Page size used by object context.
        See Also:
        Constant Field Values
      • FOLDER_PAGE_SIZE

        public static final int FOLDER_PAGE_SIZE
        Page size used by folder context and children/change iterators for large data sets.
        See Also:
        Constant Field Values
      • TOKEN_DATATIME_FORMAT

        public static final String TOKEN_DATATIME_FORMAT
        The Constant TOKEN_DATATIME_FORMAT.
        See Also:
        Constant Field Values
      • EMPTY_TOKEN

        public static final String EMPTY_TOKEN
        The Constant EMPTY_TOKEN.
      • CONNECTION_TIMEOUT

        public static final int CONNECTION_TIMEOUT
        Open CMIS connection timeout.
        See Also:
        Constant Field Values
      • FILE_PROPERTY_SET

        protected static final Set<String> FILE_PROPERTY_SET
        Set of properties for CMIS files (document or folder).
      • FOLDER_PROPERTY_SET

        protected static final Set<String> FOLDER_PROPERTY_SET
        Set of properties for CMIS folder.
      • session

        protected final AtomicReference<org.apache.chemistry.opencmis.client.api.Session> session
        Session holder.
      • parameters

        protected Map<String,​String> parameters
        Client session parameters.
      • repositoryId

        protected String repositoryId
        Current CMIS repository Id.
      • repositoryName

        protected String repositoryName
        Current CMIS repository name;.
      • productName

        protected String productName
        The product name.
      • productVersion

        protected String productVersion
        The product version.
      • vendorName

        protected String vendorName
        The vendor name.
      • enterpriseId

        protected String enterpriseId
        The custom domain.
      • enterpriseName

        protected String enterpriseName
        The custom domain.
      • customDomain

        protected String customDomain
        The custom domain.
      • fileContext

        protected org.apache.chemistry.opencmis.client.api.OperationContext fileContext
        OpenCMIS context for object operations.
      • folderContext

        protected org.apache.chemistry.opencmis.client.api.OperationContext folderContext
        OpenCMIS context for folder operations.
    • Constructor Detail

      • CMISAPI

        protected CMISAPI​(String serviceURL,
                          String user,
                          String password)
                   throws CMISException,
                          org.exoplatform.services.cms.clouddrives.CloudDriveException
        Create API from user credentials.
        Parameters:
        serviceURL - String CMIS service URL (AtimPub binding)
        user - String CMIS service username
        password - String CMIS service user password
        Throws:
        CMISException - the CMIS exception
        org.exoplatform.services.cms.clouddrives.CloudDriveException - the cloud drive exception
    • Method Detail

      • updateUser

        protected void updateUser​(Map<String,​String> parameters)
        Update user credentials.
        Parameters:
        parameters - Map of connection parameters
      • getParamaters

        protected Map<String,​String> getParamaters()
        Gets the paramaters.
        Returns:
        CMIS session parameters.
      • getUser

        protected String getUser()
        Currently connected cloud user name.
        Returns:
        String
      • getPassword

        protected String getPassword()
        Password of currently connected cloud user.
        Returns:
        String
      • getServiceURL

        protected String getServiceURL()
        CMIS service's AtomPub URL.
        Returns:
        String
      • initRepository

        protected void initRepository​(String repositoryId)
                               throws CMISException,
                                      org.exoplatform.services.cms.clouddrives.RefreshAccessException
        Init current CMIS repository for late use.
        Parameters:
        repositoryId - String repository name
        Throws:
        CMISException - the CMIS exception
        org.exoplatform.services.cms.clouddrives.RefreshAccessException - the refresh access exception
      • getRepositoryId

        public String getRepositoryId()
        Current CMIS repository.
        Returns:
        the repository
      • getRepositoryName

        public String getRepositoryName()
        Gets the current CMIS repository name;.
        Returns:
        the current CMIS repository name;
      • getProductName

        public String getProductName()
        Gets the product name.
        Returns:
        the productName
      • getProductVersion

        public String getProductVersion()
        Gets the product version.
        Returns:
        the productVersion
      • getVendorName

        public String getVendorName()
        Gets the vendor name.
        Returns:
        the vendorName
      • getUserTitle

        public String getUserTitle()
        Gets the user title.
        Returns:
        the user title
      • getRepositories

        protected List<org.apache.chemistry.opencmis.client.api.Repository> getRepositories()
                                                                                     throws CMISException,
                                                                                            org.exoplatform.services.cms.clouddrives.RefreshAccessException
        Available repositories for current user.
        Returns:
        list of Repository objects
        Throws:
        CMISException - the CMIS exception
        org.exoplatform.services.cms.clouddrives.RefreshAccessException - the refresh access exception
      • getRootFolder

        protected org.apache.chemistry.opencmis.client.api.Folder getRootFolder()
                                                                         throws CMISException,
                                                                                org.exoplatform.services.cms.clouddrives.RefreshAccessException,
                                                                                org.exoplatform.services.cms.clouddrives.UnauthorizedException
        The drive root folder.
        Returns:
        Folder
        Throws:
        CMISException - the CMIS exception
        org.exoplatform.services.cms.clouddrives.RefreshAccessException - the refresh access exception
        org.exoplatform.services.cms.clouddrives.UnauthorizedException - the unauthorized exception
      • readObject

        protected org.apache.chemistry.opencmis.client.api.CmisObject readObject​(String id,
                                                                                 org.apache.chemistry.opencmis.client.api.Session session,
                                                                                 org.apache.chemistry.opencmis.client.api.OperationContext context)
        For internal use. This method doesn't handle OpenCMIS exceptions.
        Parameters:
        id - String
        session - Session
        context - OperationContext
        Returns:
        CmisObject
      • getObject

        protected org.apache.chemistry.opencmis.client.api.CmisObject getObject​(String objectId)
                                                                         throws CMISException,
                                                                                org.exoplatform.services.cms.clouddrives.NotFoundException,
                                                                                org.exoplatform.services.cms.clouddrives.CloudDriveAccessException,
                                                                                org.exoplatform.services.cms.clouddrives.UnauthorizedException
        Return CMIS object from the repository.
        Parameters:
        objectId - String
        Returns:
        CmisObject
        Throws:
        CMISException - the CMIS exception
        org.exoplatform.services.cms.clouddrives.NotFoundException - the not found exception
        org.exoplatform.services.cms.clouddrives.CloudDriveAccessException - the cloud drive access exception
        org.exoplatform.services.cms.clouddrives.UnauthorizedException - the unauthorized exception
      • readDocumentVersionOrPWC

        protected org.apache.chemistry.opencmis.client.api.Document readDocumentVersionOrPWC​(String id)
                                                                                      throws org.exoplatform.services.cms.clouddrives.CloudDriveAccessException,
                                                                                             org.exoplatform.services.cms.clouddrives.UnauthorizedException
        Read document version or PWC.
        Parameters:
        id - the id
        Returns:
        the document
        Throws:
        org.exoplatform.services.cms.clouddrives.CloudDriveAccessException - the cloud drive access exception
        org.exoplatform.services.cms.clouddrives.UnauthorizedException - the unauthorized exception
      • getLatestDocumentVersionOrPWC

        protected org.apache.chemistry.opencmis.client.api.Document getLatestDocumentVersionOrPWC​(String id)
                                                                                           throws CMISException,
                                                                                                  org.exoplatform.services.cms.clouddrives.NotFoundException,
                                                                                                  org.exoplatform.services.cms.clouddrives.CloudDriveAccessException,
                                                                                                  org.exoplatform.services.cms.clouddrives.UnauthorizedException
        Return latest versions of CMIS document in repository. If document is checked out by current user and the private working copy (PWC) available it will be returned.
        Parameters:
        id - String
        Returns:
        Document
        Throws:
        CMISException - the CMIS exception
        org.exoplatform.services.cms.clouddrives.NotFoundException - the not found exception
        org.exoplatform.services.cms.clouddrives.CloudDriveAccessException - the cloud drive access exception
        org.exoplatform.services.cms.clouddrives.UnauthorizedException - the unauthorized exception
      • getAllVersion

        protected List<org.apache.chemistry.opencmis.client.api.Document> getAllVersion​(org.apache.chemistry.opencmis.client.api.Document document)
                                                                                 throws CMISException,
                                                                                        org.exoplatform.services.cms.clouddrives.NotFoundException,
                                                                                        org.exoplatform.services.cms.clouddrives.CloudDriveAccessException,
                                                                                        org.exoplatform.services.cms.clouddrives.UnauthorizedException
        Return all versions of CMIS document in repository.
        Parameters:
        document - Document
        Returns:
        list of Document versions
        Throws:
        CMISException - the CMIS exception
        org.exoplatform.services.cms.clouddrives.NotFoundException - the not found exception
        org.exoplatform.services.cms.clouddrives.CloudDriveAccessException - the cloud drive access exception
        org.exoplatform.services.cms.clouddrives.UnauthorizedException - the unauthorized exception
      • getParents

        protected Collection<org.apache.chemistry.opencmis.client.api.Folder> getParents​(org.apache.chemistry.opencmis.client.api.CmisObject obj)
                                                                                  throws CMISException,
                                                                                         org.exoplatform.services.cms.clouddrives.CloudDriveAccessException,
                                                                                         org.exoplatform.services.cms.clouddrives.UnauthorizedException
        Return the parent folder(s) for the specified object. If it is not fileable object then empty result will be returned. A single parent will be always for a folder.
        Parameters:
        obj - CmisObject
        Returns:
        collection of Folder parents
        Throws:
        CMISException - the CMIS exception
        org.exoplatform.services.cms.clouddrives.CloudDriveAccessException - the cloud drive access exception
        org.exoplatform.services.cms.clouddrives.UnauthorizedException - the unauthorized exception
      • getFolderItems

        protected CMISAPI.ChildrenIterator getFolderItems​(String folderId)
                                                   throws org.exoplatform.services.cms.clouddrives.CloudDriveException
        Gets the folder items.
        Parameters:
        folderId - the folder id
        Returns:
        the folder items
        Throws:
        org.exoplatform.services.cms.clouddrives.CloudDriveException - the cloud drive exception
      • getFolderItems

        protected CMISAPI.ChildrenIterator getFolderItems​(org.apache.chemistry.opencmis.client.api.Folder folder)
                                                   throws org.exoplatform.services.cms.clouddrives.CloudDriveException
        Gets the folder items.
        Parameters:
        folder - the folder
        Returns:
        the folder items
        Throws:
        org.exoplatform.services.cms.clouddrives.CloudDriveException - the cloud drive exception
      • getChanges

        protected CMISAPI.ChangesIterator getChanges​(CMISAPI.ChangeToken changeToken)
                                              throws CMISException,
                                                     org.exoplatform.services.cms.clouddrives.CloudDriveAccessException
        Gets the changes.
        Parameters:
        changeToken - the change token
        Returns:
        the changes
        Throws:
        CMISException - the CMIS exception
        org.exoplatform.services.cms.clouddrives.CloudDriveAccessException - the cloud drive access exception
      • getLink

        protected String getLink​(org.apache.chemistry.opencmis.client.api.CmisObject file)
                          throws CMISException,
                                 org.exoplatform.services.cms.clouddrives.RefreshAccessException
        Link (URl) to a file for opening on provider site (UI).
        Parameters:
        file - the file
        Returns:
        String with the file URL.
        Throws:
        CMISException - the CMIS exception
        org.exoplatform.services.cms.clouddrives.RefreshAccessException - the refresh access exception
      • getLink

        protected String getLink​(org.apache.chemistry.opencmis.client.api.Folder file)
                          throws CMISException,
                                 org.exoplatform.services.cms.clouddrives.RefreshAccessException
        Link (URl) to a folder for downloading from provider site.
        Parameters:
        file - the file
        Returns:
        String with the file URL.
        Throws:
        CMISException - the CMIS exception
        org.exoplatform.services.cms.clouddrives.RefreshAccessException - the refresh access exception
      • createDocument

        protected org.apache.chemistry.opencmis.client.api.Document createDocument​(String parentId,
                                                                                   String name,
                                                                                   String mimeType,
                                                                                   InputStream data)
                                                                            throws CMISException,
                                                                                   org.exoplatform.services.cms.clouddrives.NotFoundException,
                                                                                   org.exoplatform.services.cms.clouddrives.ConflictException,
                                                                                   org.exoplatform.services.cms.clouddrives.CloudDriveAccessException,
                                                                                   org.exoplatform.services.cms.clouddrives.ConstraintException,
                                                                                   org.exoplatform.services.cms.clouddrives.UnauthorizedException
        Creates the document.
        Parameters:
        parentId - the parent id
        name - the name
        mimeType - the mime type
        data - the data
        Returns:
        the document
        Throws:
        CMISException - the CMIS exception
        org.exoplatform.services.cms.clouddrives.NotFoundException - the not found exception
        org.exoplatform.services.cms.clouddrives.ConflictException - the conflict exception
        org.exoplatform.services.cms.clouddrives.CloudDriveAccessException - the cloud drive access exception
        org.exoplatform.services.cms.clouddrives.ConstraintException - the constraint exception
        org.exoplatform.services.cms.clouddrives.UnauthorizedException - the unauthorized exception
      • createFolder

        protected org.apache.chemistry.opencmis.client.api.Folder createFolder​(String parentId,
                                                                               String name)
                                                                        throws CMISException,
                                                                               org.exoplatform.services.cms.clouddrives.NotFoundException,
                                                                               org.exoplatform.services.cms.clouddrives.ConflictException,
                                                                               org.exoplatform.services.cms.clouddrives.CloudDriveAccessException,
                                                                               org.exoplatform.services.cms.clouddrives.ConstraintException,
                                                                               org.exoplatform.services.cms.clouddrives.UnauthorizedException
        Creates the folder.
        Parameters:
        parentId - the parent id
        name - the name
        Returns:
        the folder
        Throws:
        CMISException - the CMIS exception
        org.exoplatform.services.cms.clouddrives.NotFoundException - the not found exception
        org.exoplatform.services.cms.clouddrives.ConflictException - the conflict exception
        org.exoplatform.services.cms.clouddrives.CloudDriveAccessException - the cloud drive access exception
        org.exoplatform.services.cms.clouddrives.ConstraintException - the constraint exception
        org.exoplatform.services.cms.clouddrives.UnauthorizedException - the unauthorized exception
      • deleteDocument

        protected void deleteDocument​(String id)
                               throws CMISException,
                                      org.exoplatform.services.cms.clouddrives.NotFoundException,
                                      org.exoplatform.services.cms.clouddrives.ConflictException,
                                      org.exoplatform.services.cms.clouddrives.CloudDriveAccessException,
                                      org.exoplatform.services.cms.clouddrives.ConstraintException,
                                      org.exoplatform.services.cms.clouddrives.UnauthorizedException
        Delete a cloud file by given fileId.
        Parameters:
        id - String
        Throws:
        CMISException - the CMIS exception
        org.exoplatform.services.cms.clouddrives.NotFoundException - the not found exception
        org.exoplatform.services.cms.clouddrives.ConflictException - the conflict exception
        org.exoplatform.services.cms.clouddrives.CloudDriveAccessException - the cloud drive access exception
        org.exoplatform.services.cms.clouddrives.ConstraintException - the constraint exception
        org.exoplatform.services.cms.clouddrives.UnauthorizedException - the unauthorized exception
      • deleteFolder

        protected void deleteFolder​(String id)
                             throws CMISException,
                                    org.exoplatform.services.cms.clouddrives.NotFoundException,
                                    org.exoplatform.services.cms.clouddrives.ConflictException,
                                    org.exoplatform.services.cms.clouddrives.CloudDriveAccessException,
                                    org.exoplatform.services.cms.clouddrives.ConstraintException,
                                    org.exoplatform.services.cms.clouddrives.UnauthorizedException
        Delete a cloud folder by given folderId.
        Parameters:
        id - String
        Throws:
        CMISException - the CMIS exception
        org.exoplatform.services.cms.clouddrives.NotFoundException - the not found exception
        org.exoplatform.services.cms.clouddrives.ConflictException - the conflict exception
        org.exoplatform.services.cms.clouddrives.CloudDriveAccessException - the cloud drive access exception
        org.exoplatform.services.cms.clouddrives.ConstraintException - the constraint exception
        org.exoplatform.services.cms.clouddrives.UnauthorizedException - the unauthorized exception
      • updateContent

        protected org.apache.chemistry.opencmis.client.api.Document updateContent​(String id,
                                                                                  String name,
                                                                                  InputStream data,
                                                                                  String mimeType,
                                                                                  JCRLocalCMISDrive.LocalFile local)
                                                                           throws CMISException,
                                                                                  org.exoplatform.services.cms.clouddrives.NotFoundException,
                                                                                  org.exoplatform.services.cms.clouddrives.ConflictException,
                                                                                  org.exoplatform.services.cms.clouddrives.CloudDriveAccessException,
                                                                                  org.exoplatform.services.cms.clouddrives.ConstraintException,
                                                                                  org.exoplatform.services.cms.clouddrives.UnauthorizedException
        Update document name (if differs with remote) and its content stream.
        Parameters:
        id - String
        name - String
        data - InputStream content stream
        mimeType - String mime-type of the content stream
        local - JCRLocalCMISDrive.LocalFile access to local file for move operation support
        Returns:
        Document of actually changed document
        Throws:
        CMISException - the CMIS exception
        org.exoplatform.services.cms.clouddrives.NotFoundException - the not found exception
        org.exoplatform.services.cms.clouddrives.ConflictException - the conflict exception
        org.exoplatform.services.cms.clouddrives.CloudDriveAccessException - the cloud drive access exception
        org.exoplatform.services.cms.clouddrives.ConstraintException - the constraint exception
        org.exoplatform.services.cms.clouddrives.UnauthorizedException - the unauthorized exception
      • updateObject

        protected org.apache.chemistry.opencmis.client.api.CmisObject updateObject​(String parentId,
                                                                                   String id,
                                                                                   String name,
                                                                                   JCRLocalCMISDrive.LocalFile local)
                                                                            throws CMISException,
                                                                                   org.exoplatform.services.cms.clouddrives.NotFoundException,
                                                                                   org.exoplatform.services.cms.clouddrives.ConflictException,
                                                                                   org.exoplatform.services.cms.clouddrives.CloudDriveAccessException,
                                                                                   org.exoplatform.services.cms.clouddrives.ConstraintException,
                                                                                   org.exoplatform.services.cms.clouddrives.UnauthorizedException
        Update CMIS object name and parent (if object was moved locally).
        Parameters:
        parentId - String
        id - String
        name - String
        local - JCRLocalCMISDrive.LocalFile access to local file for move operation support
        Returns:
        CmisObject of actually changed object or null if it already exists with such name and parent.
        Throws:
        CMISException - the CMIS exception
        org.exoplatform.services.cms.clouddrives.NotFoundException - the not found exception
        org.exoplatform.services.cms.clouddrives.ConflictException - the conflict exception
        org.exoplatform.services.cms.clouddrives.CloudDriveAccessException - the cloud drive access exception
        org.exoplatform.services.cms.clouddrives.ConstraintException - the constraint exception
        org.exoplatform.services.cms.clouddrives.UnauthorizedException - the unauthorized exception
      • rename

        protected org.apache.chemistry.opencmis.client.api.CmisObject rename​(String newName,
                                                                             org.apache.chemistry.opencmis.client.api.CmisObject obj,
                                                                             org.apache.chemistry.opencmis.client.api.Session session)
        Rename CMIS object by better way working for the CMIS provider (this method can be overridden in dedicated implementations). By default it uses obj.rename() method.
        Parameters:
        newName - String new name
        obj - CmisObject
        session - Session
        Returns:
        CmisObject renamed object
      • copyDocument

        @Deprecated
        protected org.apache.chemistry.opencmis.client.api.Document copyDocument​(String id,
                                                                                 String parentId,
                                                                                 String name)
                                                                          throws CMISException,
                                                                                 org.exoplatform.services.cms.clouddrives.NotFoundException,
                                                                                 org.exoplatform.services.cms.clouddrives.ConflictException,
                                                                                 org.exoplatform.services.cms.clouddrives.CloudDriveAccessException,
                                                                                 org.exoplatform.services.cms.clouddrives.ConstraintException,
                                                                                 org.exoplatform.services.cms.clouddrives.UnauthorizedException
        Deprecated.
        Copy document to a new one. If file was successfully copied this method return new document object.
        Parameters:
        id - String
        parentId - String
        name - String
        Returns:
        Document of actually copied file.
        Throws:
        CMISException - the CMIS exception
        org.exoplatform.services.cms.clouddrives.NotFoundException - the not found exception
        org.exoplatform.services.cms.clouddrives.ConflictException - the conflict exception
        org.exoplatform.services.cms.clouddrives.CloudDriveAccessException - the cloud drive access exception
        org.exoplatform.services.cms.clouddrives.ConstraintException - the constraint exception
        org.exoplatform.services.cms.clouddrives.UnauthorizedException - the unauthorized exception
      • copyDocument

        protected org.apache.chemistry.opencmis.client.api.Document copyDocument​(org.apache.chemistry.opencmis.client.api.Document source,
                                                                                 org.apache.chemistry.opencmis.client.api.Folder parent,
                                                                                 String name)
                                                                          throws CMISException,
                                                                                 org.exoplatform.services.cms.clouddrives.NotFoundException,
                                                                                 org.exoplatform.services.cms.clouddrives.ConflictException,
                                                                                 org.exoplatform.services.cms.clouddrives.CloudDriveAccessException,
                                                                                 org.exoplatform.services.cms.clouddrives.ConstraintException,
                                                                                 org.exoplatform.services.cms.clouddrives.UnauthorizedException
        Copy document to a new one using CMIS objects. If file was successfully copied this method return new document object.
        Parameters:
        source - Document
        parent - Folder
        name - String
        Returns:
        Document of actually copied file.
        Throws:
        CMISException - the CMIS exception
        org.exoplatform.services.cms.clouddrives.NotFoundException - the not found exception
        org.exoplatform.services.cms.clouddrives.ConflictException - the conflict exception
        org.exoplatform.services.cms.clouddrives.CloudDriveAccessException - the cloud drive access exception
        org.exoplatform.services.cms.clouddrives.ConstraintException - the constraint exception
        org.exoplatform.services.cms.clouddrives.UnauthorizedException - the unauthorized exception
      • copyFolder

        @Deprecated
        protected org.apache.chemistry.opencmis.client.api.Folder copyFolder​(String id,
                                                                             String parentId,
                                                                             String name)
                                                                      throws CMISException,
                                                                             org.exoplatform.services.cms.clouddrives.NotFoundException,
                                                                             org.exoplatform.services.cms.clouddrives.ConflictException,
                                                                             org.exoplatform.services.cms.clouddrives.CloudDriveAccessException,
                                                                             org.exoplatform.services.cms.clouddrives.ConstraintException,
                                                                             org.exoplatform.services.cms.clouddrives.UnauthorizedException
        Deprecated.
        Copy folder to a new one. If folder was successfully copied this method return new folder object. Notable that CMIS doesn't support folder copying natively and this method does recursive traversing of the source and create new folder with sub-folders from it. This may cause not full copy of a folder in general case (permissions or other metadata may not be copied).
        Parameters:
        id - String
        parentId - String
        name - String
        Returns:
        Folder of actually copied folder.
        Throws:
        CMISException - the CMIS exception
        org.exoplatform.services.cms.clouddrives.NotFoundException - the not found exception
        org.exoplatform.services.cms.clouddrives.ConflictException - the conflict exception
        org.exoplatform.services.cms.clouddrives.CloudDriveAccessException - the cloud drive access exception
        org.exoplatform.services.cms.clouddrives.ConstraintException - the constraint exception
        org.exoplatform.services.cms.clouddrives.UnauthorizedException - the unauthorized exception
        See Also:
        copyFolder(Folder, Folder, String)
      • copyFolder

        protected org.apache.chemistry.opencmis.client.api.Folder copyFolder​(org.apache.chemistry.opencmis.client.api.Folder source,
                                                                             org.apache.chemistry.opencmis.client.api.Folder parent,
                                                                             String name)
                                                                      throws CMISException,
                                                                             org.exoplatform.services.cms.clouddrives.NotFoundException,
                                                                             org.exoplatform.services.cms.clouddrives.ConflictException,
                                                                             org.exoplatform.services.cms.clouddrives.CloudDriveAccessException,
                                                                             org.exoplatform.services.cms.clouddrives.ConstraintException,
                                                                             org.exoplatform.services.cms.clouddrives.UnauthorizedException
        Copy folder to a new one using CMIS objects. If folder was successfully copied this method return new folder object.
        Notable that CMIS doesn't support folder copy and this method will create only a copy of the source folder object without copying its sub-files - they must be copied one by one by the caller.
        Parameters:
        source - the source
        parent - the parent
        name - String
        Returns:
        Folder of actually copied folder.
        Throws:
        CMISException - the CMIS exception
        org.exoplatform.services.cms.clouddrives.NotFoundException - the not found exception
        org.exoplatform.services.cms.clouddrives.ConflictException - the conflict exception
        org.exoplatform.services.cms.clouddrives.CloudDriveAccessException - the cloud drive access exception
        org.exoplatform.services.cms.clouddrives.ConstraintException - the constraint exception
        org.exoplatform.services.cms.clouddrives.UnauthorizedException - the unauthorized exception
      • getRepositoryInfo

        protected org.apache.chemistry.opencmis.commons.data.RepositoryInfo getRepositoryInfo()
                                                                                       throws CMISException,
                                                                                              org.exoplatform.services.cms.clouddrives.RefreshAccessException
        Gets the repository info.
        Returns:
        the repository info
        Throws:
        CMISException - the CMIS exception
        org.exoplatform.services.cms.clouddrives.RefreshAccessException - the refresh access exception
      • isFolder

        protected boolean isFolder​(org.apache.chemistry.opencmis.client.api.CmisObject object)
        Checks if is folder.
        Parameters:
        object - the object
        Returns:
        true, if is folder
      • isDocument

        protected boolean isDocument​(org.apache.chemistry.opencmis.client.api.CmisObject object)
        Checks if is document.
        Parameters:
        object - the object
        Returns:
        true, if is document
      • isRelationship

        protected boolean isRelationship​(org.apache.chemistry.opencmis.client.api.CmisObject object)
        Checks if is relationship.
        Parameters:
        object - the object
        Returns:
        true, if is relationship
      • isFileable

        protected boolean isFileable​(org.apache.chemistry.opencmis.client.api.CmisObject object)
        Checks if is fileable.
        Parameters:
        object - the object
        Returns:
        true, if is fileable
      • repositories

        protected List<org.apache.chemistry.opencmis.client.api.Repository> repositories()
                                                                                  throws CMISException,
                                                                                         org.exoplatform.services.cms.clouddrives.RefreshAccessException
        List of repositories available on CMIS service.
        Returns:
        list of Repository objects
        Throws:
        CMISException - when runtime or connection error happens
        org.exoplatform.services.cms.clouddrives.RefreshAccessException - if user credentials rejected (and need try renew them)
      • binding

        protected org.apache.chemistry.opencmis.commons.spi.CmisBinding binding()
                                                                         throws CMISException
        Create CMIS binding instance (low-level API but with fine grained control).
        Returns:
        CmisBinding
        Throws:
        CMISException - the CMIS exception
      • session

        protected org.apache.chemistry.opencmis.client.api.Session session()
                                                                    throws CMISException,
                                                                           org.exoplatform.services.cms.clouddrives.RefreshAccessException
        Create CMIS session.
        Returns:
        Session
        Throws:
        CMISException - the CMIS exception
        org.exoplatform.services.cms.clouddrives.RefreshAccessException - the refresh access exception
      • session

        protected org.apache.chemistry.opencmis.client.api.Session session​(boolean forceNew)
                                                                    throws CMISException,
                                                                           org.exoplatform.services.cms.clouddrives.RefreshAccessException
        Create CMIS session.
        Parameters:
        forceNew - boolean if true then session will be recreated, otherwise will try use cached in thread-local variable.
        Returns:
        Session
        Throws:
        CMISException - the CMIS exception
        org.exoplatform.services.cms.clouddrives.RefreshAccessException - the refresh access exception
      • readToken

        protected CMISAPI.ChangeToken readToken​(org.apache.chemistry.opencmis.client.api.ChangeEvent event)
                                         throws CMISException
        Read token.
        Parameters:
        event - the event
        Returns:
        the change token
        Throws:
        CMISException - the CMIS exception
      • emptyToken

        protected CMISAPI.ChangeToken emptyToken()
        Empty token.
        Returns:
        the change token
      • isVersionable

        protected boolean isVersionable​(org.apache.chemistry.opencmis.client.api.ObjectType type)
        Checks if is versionable.
        Parameters:
        type - the type
        Returns:
        true, if is versionable
      • isSyncableChange

        protected boolean isSyncableChange​(org.apache.chemistry.opencmis.client.api.ChangeEvent change)
                                    throws org.exoplatform.services.cms.clouddrives.RefreshAccessException,
                                           CMISException
        Checks if is syncable change.
        Parameters:
        change - the change
        Returns:
        true, if is syncable change
        Throws:
        org.exoplatform.services.cms.clouddrives.RefreshAccessException - the refresh access exception
        CMISException - the CMIS exception
      • shouldCheckinRename

        protected boolean shouldCheckinRename​(org.apache.chemistry.opencmis.client.api.Document doc)
        Should perform CMIS check-in after renaming of already checked-in document.
        Parameters:
        doc - the doc
        Returns:
        boolean
      • formatTokenTime

        public static String formatTokenTime​(Date date)
        Format token time.
        Parameters:
        date - the date
        Returns:
        the string