Class FileFolderServiceImpl

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      FileInfo copy​(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, org.alfresco.service.cmr.repository.NodeRef targetParentRef, java.lang.String newName)
      Copy a source file or folder.
      FileInfo create​(org.alfresco.service.cmr.repository.NodeRef parentNodeRef, java.lang.String name, org.alfresco.service.namespace.QName typeQName)
      Create a file or folder; or any valid node of type derived from file or folder.
      FileInfo create​(org.alfresco.service.cmr.repository.NodeRef parentNodeRef, java.lang.String name, org.alfresco.service.namespace.QName typeQName, org.alfresco.service.namespace.QName assocQName)
      Create a file or folder; or any valid node of type derived from file or folder
      void delete​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
      Delete a file or folder
      boolean exists​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
      Check the validity of a node reference
      FileInfo getFileInfo​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
      Get the file info (name, folder, etc) for the given node
      org.alfresco.service.cmr.repository.NodeRef getLocalizedSibling​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
      Uses the cm:name of the given node and attempts to find a sibling node with a more specific localized name.
      java.util.List<java.lang.String> getNameOnlyPath​(org.alfresco.service.cmr.repository.NodeRef rootNodeRef, org.alfresco.service.cmr.repository.NodeRef nodeRef)
      Get the file or folder names from the root down to and including the node provided.
      java.util.List<FileInfo> getNamePath​(org.alfresco.service.cmr.repository.NodeRef rootNodeRef, org.alfresco.service.cmr.repository.NodeRef nodeRef)
      Get the file or folder information from the root down to and including the node provided.
      org.alfresco.service.cmr.repository.ContentReader getReader​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
      Get the reader to the file represented by the node according to the File/Folder model.
      <M extends Trait>
      ExtendedTrait<M>
      getTrait​(java.lang.Class<? extends M> traitAPI)  
      FileFolderServiceType getType​(org.alfresco.service.namespace.QName typeQName)
      Checks the type for whether it is a recognised file or folder type or is invalid for the FileFolderService.
      org.alfresco.service.cmr.repository.ContentWriter getWriter​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
      Get the writer to the file represented by the node according to the File/Folder model.
      void init()  
      boolean isHidden​(org.alfresco.service.cmr.repository.NodeRef nodeRef)  
      boolean isPreserveAuditableData()  
      java.util.List<FileInfo> list​(org.alfresco.service.cmr.repository.NodeRef contextNodeRef)
      Lists immediate child files and folders of the given context node.
      org.alfresco.query.PagingResults<FileInfo> list​(org.alfresco.service.cmr.repository.NodeRef contextNodeRef, boolean files, boolean folders, java.lang.String pattern, java.util.Set<org.alfresco.service.namespace.QName> ignoreQNames, java.util.List<org.alfresco.util.Pair<org.alfresco.service.namespace.QName,​java.lang.Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest)
      Lists page of immediate child files and/or folders of the given context node with pattern matching and optional filtering (exclusion of certain child file/folder subtypes) and sorting Pattern uses '*' as a wildcard
      org.alfresco.query.PagingResults<FileInfo> list​(org.alfresco.service.cmr.repository.NodeRef contextNodeRef, boolean files, boolean folders, java.util.Set<org.alfresco.service.namespace.QName> ignoreQNames, java.util.List<org.alfresco.util.Pair<org.alfresco.service.namespace.QName,​java.lang.Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest)
      Lists page of immediate child files and/or folders of the given context node with optional filtering (exclusion of certain child file/folder subtypes) and sorting

      author janv
      org.alfresco.query.PagingResults<FileInfo> list​(org.alfresco.service.cmr.repository.NodeRef rootNodeRef, java.util.Set<org.alfresco.service.namespace.QName> searchTypeQNames, java.util.Set<org.alfresco.service.namespace.QName> ignoreAspectQNames, java.util.List<org.alfresco.util.Pair<org.alfresco.service.namespace.QName,​java.lang.Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest)
      Lists page of immediate child objects of the given context node with specification of which types to list and optional filtering (exclusion of certain child file/folder subtypes) and sorting
      org.alfresco.query.PagingResults<FileInfo> list​(org.alfresco.service.cmr.repository.NodeRef rootNodeRef, java.util.Set<org.alfresco.service.namespace.QName> assocTypeQNames, java.util.Set<org.alfresco.service.namespace.QName> searchTypeQNames, java.util.Set<org.alfresco.service.namespace.QName> ignoreAspectQNames, java.util.List<org.alfresco.util.Pair<org.alfresco.service.namespace.QName,​java.lang.Boolean>> sortProps, java.util.List<FilterProp> filterProps, org.alfresco.query.PagingRequest pagingRequest)
      Lists page of immediate child objects of the given context node with specification of which types to list and optional filtering (exclusion of certain child file/folder subtypes) and sorting
      java.util.List<FileInfo> listDeepFolders​(org.alfresco.service.cmr.repository.NodeRef contextNodeRef, SubFolderFilter filter)
      Lists all folders below the given context node, both immediate and lower levels The filter parameter allows subfolders to be excluded from the search.
      java.util.List<FileInfo> listFiles​(org.alfresco.service.cmr.repository.NodeRef contextNodeRef)
      Lists all immediate child files of the given context node Note: this could be a long list (and will be trimmed at a pre-configured maximum).
      java.util.List<FileInfo> listFolders​(org.alfresco.service.cmr.repository.NodeRef contextNodeRef)
      Lists all immediate child folders of the given context node Note: this could be a long list (and will be trimmed at a pre-configured maximum).
      static FileInfo makeFolders​(FileFolderService service, org.alfresco.service.cmr.repository.NodeRef parentNodeRef, java.util.List<java.lang.String> pathElements, org.alfresco.service.namespace.QName folderTypeQName)
      Deprecated.
      Use FileFolderUtil.makeFolders rather than directly accessing this implementation class.
      FileInfo makeFolders​(org.alfresco.service.cmr.repository.NodeRef parentNodeRef, java.util.List<java.lang.String> pathElements, org.alfresco.service.namespace.QName folderTypeQName)
      Deprecated.
      Use FileFolderUtil.makeFolders rather than directly accessing this implementation class.
      FileInfo move​(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, org.alfresco.service.cmr.repository.NodeRef targetParentRef, java.lang.String newName)
      Move a file or folder to a new name and/or location.
      FileInfo move​(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, org.alfresco.service.cmr.repository.NodeRef sourceParentRef, org.alfresco.service.cmr.repository.NodeRef targetParentRef, java.lang.String newName)
      Deprecated. 
      FileInfo moveFrom​(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, org.alfresco.service.cmr.repository.NodeRef sourceParentRef, org.alfresco.service.cmr.repository.NodeRef targetParentRef, java.lang.String newName)
      Move a file or folder to a new name and/or location.
      FileInfo rename​(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, java.lang.String newName)
      Rename a file or folder in its current location
      FileInfo resolveNamePath​(org.alfresco.service.cmr.repository.NodeRef rootNodeRef, java.util.List<java.lang.String> pathElements)
      Resolve a file or folder name path from a given root node down to the final node.
      FileInfo resolveNamePath​(org.alfresco.service.cmr.repository.NodeRef rootNodeRef, java.util.List<java.lang.String> pathElements, boolean mustExist)
      Resolve a file or folder name path from a given root node down to the final node.
      java.util.List<FileInfo> search​(org.alfresco.service.cmr.repository.NodeRef contextNodeRef, java.lang.String namePattern, boolean includeSubFolders)
      Searches for all files and folders with the matching name pattern, using wildcard characters * and ?.
      java.util.List<FileInfo> search​(org.alfresco.service.cmr.repository.NodeRef contextNodeRef, java.lang.String namePattern, boolean fileSearch, boolean folderSearch, boolean includeSubFolders)
      Full search with all options
      org.alfresco.service.cmr.repository.NodeRef searchSimple​(org.alfresco.service.cmr.repository.NodeRef contextNodeRef, java.lang.String name)
      Get a node ref of the node that has the name within the parent node
      void setBehaviourFilter​(BehaviourFilter behaviourFilter)  
      void setCannedQueryRegistry​(org.alfresco.util.registry.NamedObjectRegistry<org.alfresco.query.CannedQueryFactory<org.alfresco.service.cmr.repository.NodeRef>> cannedQueryRegistry)
      Set the registry of canned queries
      void setContentService​(ContentService contentService)  
      void setCopyService​(CopyService copyService)  
      void setDefaultListMaxResults​(int defaultListMaxResults)  
      void setDictionaryService​(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)  
      void setHidden​(org.alfresco.service.cmr.repository.NodeRef nodeRef, boolean isHidden)  
      void setHiddenAspect​(HiddenAspect hiddenAspect)  
      void setMimetypeService​(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)  
      void setNamespaceService​(org.alfresco.service.namespace.NamespaceService namespaceService)  
      void setNodeService​(org.alfresco.service.cmr.repository.NodeService nodeService)  
      void setPreserveAuditableData​(boolean preserveAuditableData)  
      void setSearchService​(org.alfresco.service.cmr.search.SearchService searchService)  
      void setSystemPaths​(java.util.List<java.lang.String> systemPaths)  
      java.util.List<FileInfo> toFileInfoList​(java.util.List<org.alfresco.service.cmr.repository.NodeRef> nodeRefs)
      Helper method to transform a list of NodeRef to a list of FileInfo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FileFolderServiceImpl

        public FileFolderServiceImpl()
        Default constructor
    • Method Detail

      • setNamespaceService

        public void setNamespaceService​(org.alfresco.service.namespace.NamespaceService namespaceService)
      • setDictionaryService

        public void setDictionaryService​(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
      • setNodeService

        public void setNodeService​(org.alfresco.service.cmr.repository.NodeService nodeService)
      • setCopyService

        public void setCopyService​(CopyService copyService)
      • setSearchService

        public void setSearchService​(org.alfresco.service.cmr.search.SearchService searchService)
      • setContentService

        public void setContentService​(ContentService contentService)
      • setMimetypeService

        public void setMimetypeService​(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
      • setHiddenAspect

        public void setHiddenAspect​(HiddenAspect hiddenAspect)
      • setCannedQueryRegistry

        public void setCannedQueryRegistry​(org.alfresco.util.registry.NamedObjectRegistry<org.alfresco.query.CannedQueryFactory<org.alfresco.service.cmr.repository.NodeRef>> cannedQueryRegistry)
        Set the registry of canned queries
      • setSystemPaths

        public void setSystemPaths​(java.util.List<java.lang.String> systemPaths)
      • setDefaultListMaxResults

        public void setDefaultListMaxResults​(int defaultListMaxResults)
      • setBehaviourFilter

        public void setBehaviourFilter​(BehaviourFilter behaviourFilter)
      • setPreserveAuditableData

        public void setPreserveAuditableData​(boolean preserveAuditableData)
      • isPreserveAuditableData

        public boolean isPreserveAuditableData()
      • init

        public void init()
      • exists

        public boolean exists​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
        Description copied from interface: FileFolderService
        Check the validity of a node reference
        Specified by:
        exists in interface FileFolderService
        Returns:
        returns true if the NodeRef is valid
      • getType

        public FileFolderServiceType getType​(org.alfresco.service.namespace.QName typeQName)
        Description copied from interface: FileFolderService
        Checks the type for whether it is a recognised file or folder type or is invalid for the FileFolderService.
        Specified by:
        getType in interface FileFolderService
        Parameters:
        typeQName - the type to check
        Returns:
        - the type
      • list

        public java.util.List<FileInfo> list​(org.alfresco.service.cmr.repository.NodeRef contextNodeRef)
        Description copied from interface: FileFolderService
        Lists immediate child files and folders of the given context node.

        Note: this could be a long list (and will be trimmed at a pre-configured maximum). You should consider using a paging request.

        Specified by:
        list in interface FileFolderService
        Parameters:
        contextNodeRef - the node to start searching in
        Returns:
        Returns a list of matching files and folders
      • list

        @Auditable(parameters={"contextNodeRef","files","folders","ignoreQNames","sortProps","pagingRequest"})
        public org.alfresco.query.PagingResults<FileInfo> list​(org.alfresco.service.cmr.repository.NodeRef contextNodeRef,
                                                               boolean files,
                                                               boolean folders,
                                                               java.util.Set<org.alfresco.service.namespace.QName> ignoreQNames,
                                                               java.util.List<org.alfresco.util.Pair<org.alfresco.service.namespace.QName,​java.lang.Boolean>> sortProps,
                                                               org.alfresco.query.PagingRequest pagingRequest)
        Description copied from interface: FileFolderService
        Lists page of immediate child files and/or folders of the given context node with optional filtering (exclusion of certain child file/folder subtypes) and sorting

        author janv
        Specified by:
        list in interface FileFolderService
      • list

        public org.alfresco.query.PagingResults<FileInfo> list​(org.alfresco.service.cmr.repository.NodeRef contextNodeRef,
                                                               boolean files,
                                                               boolean folders,
                                                               java.lang.String pattern,
                                                               java.util.Set<org.alfresco.service.namespace.QName> ignoreQNames,
                                                               java.util.List<org.alfresco.util.Pair<org.alfresco.service.namespace.QName,​java.lang.Boolean>> sortProps,
                                                               org.alfresco.query.PagingRequest pagingRequest)
        Description copied from interface: FileFolderService
        Lists page of immediate child files and/or folders of the given context node with pattern matching and optional filtering (exclusion of certain child file/folder subtypes) and sorting Pattern uses '*' as a wildcard
        Specified by:
        list in interface FileFolderService
      • list

        public org.alfresco.query.PagingResults<FileInfo> list​(org.alfresco.service.cmr.repository.NodeRef rootNodeRef,
                                                               java.util.Set<org.alfresco.service.namespace.QName> searchTypeQNames,
                                                               java.util.Set<org.alfresco.service.namespace.QName> ignoreAspectQNames,
                                                               java.util.List<org.alfresco.util.Pair<org.alfresco.service.namespace.QName,​java.lang.Boolean>> sortProps,
                                                               org.alfresco.query.PagingRequest pagingRequest)
        Description copied from interface: FileFolderService
        Lists page of immediate child objects of the given context node with specification of which types to list and optional filtering (exclusion of certain child file/folder subtypes) and sorting
        Specified by:
        list in interface FileFolderService
        Parameters:
        rootNodeRef - NodeRef
        searchTypeQNames - QNames of types to list
        pagingRequest - PagingRequest
        Returns:
        list of node refs, never null
      • list

        public org.alfresco.query.PagingResults<FileInfo> list​(org.alfresco.service.cmr.repository.NodeRef rootNodeRef,
                                                               java.util.Set<org.alfresco.service.namespace.QName> assocTypeQNames,
                                                               java.util.Set<org.alfresco.service.namespace.QName> searchTypeQNames,
                                                               java.util.Set<org.alfresco.service.namespace.QName> ignoreAspectQNames,
                                                               java.util.List<org.alfresco.util.Pair<org.alfresco.service.namespace.QName,​java.lang.Boolean>> sortProps,
                                                               java.util.List<FilterProp> filterProps,
                                                               org.alfresco.query.PagingRequest pagingRequest)
        Description copied from interface: FileFolderService
        Lists page of immediate child objects of the given context node with specification of which types to list and optional filtering (exclusion of certain child file/folder subtypes) and sorting
        Specified by:
        list in interface FileFolderService
        Parameters:
        rootNodeRef - NodeRef
        assocTypeQNames - QNames of assoc types to list
        searchTypeQNames - QNames of node types to list
        pagingRequest - PagingRequest
        Returns:
        list of node refs, never null
      • listFiles

        public java.util.List<FileInfo> listFiles​(org.alfresco.service.cmr.repository.NodeRef contextNodeRef)
        Description copied from interface: FileFolderService
        Lists all immediate child files of the given context node Note: this could be a long list (and will be trimmed at a pre-configured maximum). You should consider using a paging request.
        Specified by:
        listFiles in interface FileFolderService
        Parameters:
        contextNodeRef - the folder nodeRef to start searching in
        Returns:
        Returns a list of matching files
      • listFolders

        public java.util.List<FileInfo> listFolders​(org.alfresco.service.cmr.repository.NodeRef contextNodeRef)
        Description copied from interface: FileFolderService
        Lists all immediate child folders of the given context node Note: this could be a long list (and will be trimmed at a pre-configured maximum). You should consider using a paging request.
        Specified by:
        listFolders in interface FileFolderService
        Parameters:
        contextNodeRef - the node to start searching in
        Returns:
        Returns a list of matching folders
      • listDeepFolders

        public java.util.List<FileInfo> listDeepFolders​(org.alfresco.service.cmr.repository.NodeRef contextNodeRef,
                                                        SubFolderFilter filter)
        Description copied from interface: FileFolderService
        Lists all folders below the given context node, both immediate and lower levels The filter parameter allows subfolders to be excluded from the search.
        Specified by:
        listDeepFolders in interface FileFolderService
        Parameters:
        contextNodeRef - the node to start searching in
        filter - - may be null in which case all sub-folders will be searched
      • getLocalizedSibling

        public org.alfresco.service.cmr.repository.NodeRef getLocalizedSibling​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
        Description copied from interface: FileFolderService
        Uses the cm:name of the given node and attempts to find a sibling node with a more specific localized name. The node passed in must represent the base of the possible translations i.e. the base name for the resource names will be calculated using the filename without extension. The locale used will come from the thread's default locale.
        Specified by:
        getLocalizedSibling in interface FileFolderService
        Parameters:
        nodeRef - the node that acts as the baseline for the search
        Returns:
        Returns a sibling node or the original node
      • searchSimple

        public org.alfresco.service.cmr.repository.NodeRef searchSimple​(org.alfresco.service.cmr.repository.NodeRef contextNodeRef,
                                                                        java.lang.String name)
        Description copied from interface: FileFolderService
        Get a node ref of the node that has the name within the parent node
        Specified by:
        searchSimple in interface FileFolderService
        Parameters:
        contextNodeRef - the parent node
        name - the name of the node to search for
        Returns:
        Returns the node that has the given name - or null if not found
      • search

        public java.util.List<FileInfo> search​(org.alfresco.service.cmr.repository.NodeRef contextNodeRef,
                                               java.lang.String namePattern,
                                               boolean includeSubFolders)
        Description copied from interface: FileFolderService
        Searches for all files and folders with the matching name pattern, using wildcard characters * and ?. Warning: Please avoid using this method with any "namePattern" other than "*". Although it works, its performance is poor, which is why this method is deprecated.
        Specified by:
        search in interface FileFolderService
        Parameters:
        contextNodeRef - the context of the search. This node will never be returned as part of the search results.
        namePattern - the name of the file or folder to search for, or a wildcard pattern to search for.
        includeSubFolders - true to search the entire hierarchy below the search context
        Returns:
        Returns a list of file or folder matches
        See Also:
        search(NodeRef, String, boolean, boolean, boolean)
      • search

        public java.util.List<FileInfo> search​(org.alfresco.service.cmr.repository.NodeRef contextNodeRef,
                                               java.lang.String namePattern,
                                               boolean fileSearch,
                                               boolean folderSearch,
                                               boolean includeSubFolders)
        Full search with all options
        Specified by:
        search in interface FileFolderService
        Parameters:
        contextNodeRef - the context of the search. This node will never be returned as part of the search results.
        namePattern - the name of the file or folder to search for, or a wildcard pattern to search for.
        fileSearch - true if file types are to be included in the search results
        folderSearch - true if folder types are to be included in the search results
        includeSubFolders - true to search the entire hierarchy below the search context
        Returns:
        Returns a list of file or folder matches
      • moveFrom

        public FileInfo moveFrom​(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef,
                                 org.alfresco.service.cmr.repository.NodeRef sourceParentRef,
                                 org.alfresco.service.cmr.repository.NodeRef targetParentRef,
                                 java.lang.String newName)
                          throws FileExistsException,
                                 FileNotFoundException
        Description copied from interface: FileFolderService
        Move a file or folder to a new name and/or location.

        If both the parent folder and name remain the same, then nothing is done.

        It is possible to specify which is the parent node when moving nodes; nodes can reside in multiple locations.

        Specified by:
        moveFrom in interface FileFolderService
        Parameters:
        sourceNodeRef - the file or folder to move
        sourceParentRef - the source parent of node - null means move from primary parent
        targetParentRef - the new parent node to move the node to - null means rename in situ
        newName - the name to change the file or folder to - null to keep the existing name
        Returns:
        Returns the new file info
        Throws:
        FileExistsException
        FileNotFoundException
        See Also:
        moveOrCopy(NodeRef, NodeRef, NodeRef, String, boolean)
      • create

        public FileInfo create​(org.alfresco.service.cmr.repository.NodeRef parentNodeRef,
                               java.lang.String name,
                               org.alfresco.service.namespace.QName typeQName)
                        throws FileExistsException
        Description copied from interface: FileFolderService
        Create a file or folder; or any valid node of type derived from file or folder.

        The association QName for the patch defaults to cm:filename i.e. the Content Model namespace with the filename as the local name.

        Specified by:
        create in interface FileFolderService
        Parameters:
        parentNodeRef - the parent node. The parent must be a valid folder.
        name - the name of the node
        typeQName - the type to create
        Returns:
        Returns the new node's file information
        Throws:
        FileExistsException
      • create

        public FileInfo create​(org.alfresco.service.cmr.repository.NodeRef parentNodeRef,
                               java.lang.String name,
                               org.alfresco.service.namespace.QName typeQName,
                               org.alfresco.service.namespace.QName assocQName)
                        throws FileExistsException
        Description copied from interface: FileFolderService
        Create a file or folder; or any valid node of type derived from file or folder
        Specified by:
        create in interface FileFolderService
        Parameters:
        parentNodeRef - the parent node. The parent must be a valid folder.
        name - the name of the node
        typeQName - the type to create
        assocQName - the association QName to set for the path (may be null).
        Returns:
        Returns the new node's file information
        Throws:
        FileExistsException
      • delete

        public void delete​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
        Description copied from interface: FileFolderService
        Delete a file or folder
        Specified by:
        delete in interface FileFolderService
        Parameters:
        nodeRef - the node to delete
      • makeFolders

        public FileInfo makeFolders​(org.alfresco.service.cmr.repository.NodeRef parentNodeRef,
                                    java.util.List<java.lang.String> pathElements,
                                    org.alfresco.service.namespace.QName folderTypeQName)
        Deprecated.
        Use FileFolderUtil.makeFolders rather than directly accessing this implementation class.
        Checks for the presence of, and creates as necessary, the folder structure in the provided path.

        An empty path list is not allowed as it would be impossible to necessarily return file info for the parent node - it might not be a folder node.

        Parameters:
        parentNodeRef - the node under which the path will be created
        pathElements - the folder name path to create - may not be empty
        folderTypeQName - the types of nodes to create. This must be a valid subtype of they folder type.
        Returns:
        Returns the info of the last folder in the path.
      • makeFolders

        public static FileInfo makeFolders​(FileFolderService service,
                                           org.alfresco.service.cmr.repository.NodeRef parentNodeRef,
                                           java.util.List<java.lang.String> pathElements,
                                           org.alfresco.service.namespace.QName folderTypeQName)
        Deprecated.
        Use FileFolderUtil.makeFolders rather than directly accessing this implementation class.
        Checks for the presence of, and creates as necessary, the folder structure in the provided path.

        An empty path list is not allowed as it would be impossible to necessarily return file info for the parent node - it might not be a folder node.

        Parameters:
        parentNodeRef - the node under which the path will be created
        pathElements - the folder name path to create - may not be empty
        folderTypeQName - the types of nodes to create. This must be a valid subtype of they folder type.
        Returns:
        Returns the info of the last folder in the path.
      • getNamePath

        public java.util.List<FileInfo> getNamePath​(org.alfresco.service.cmr.repository.NodeRef rootNodeRef,
                                                    org.alfresco.service.cmr.repository.NodeRef nodeRef)
                                             throws FileNotFoundException
        Get the file or folder information from the root down to and including the node provided.
        • The root node can be of any type and is not included in the path list.
        • Only the primary path is considered. If the target node is not a descendant of the root along purely primary associations, then an exception is generated.
        • If an invalid type is encountered along the path, then an exception is generated.
        Specified by:
        getNamePath in interface FileFolderService
        Parameters:
        rootNodeRef - the start of the returned path, or null if the store root node must be assumed.
        nodeRef - a reference to the file or folder
        Returns:
        Returns a list of file/folder infos from the root (excluded) down to and including the destination file or folder
        Throws:
        FileNotFoundException - if the node could not be found
      • getNameOnlyPath

        public java.util.List<java.lang.String> getNameOnlyPath​(org.alfresco.service.cmr.repository.NodeRef rootNodeRef,
                                                                org.alfresco.service.cmr.repository.NodeRef nodeRef)
                                                         throws FileNotFoundException
        Get the file or folder names from the root down to and including the node provided.
        • The root node can be of any type and is not included in the path list.
        • Only the primary path is considered. If the target node is not a descendant of the root along purely primary associations, then an exception is generated.
        • If an invalid type is encountered along the path, then an exception is generated.
        Specified by:
        getNameOnlyPath in interface FileFolderService
        Parameters:
        rootNodeRef - the start of the returned path, or null if the store root node must be assumed.
        nodeRef - a reference to the file or folder
        Returns:
        Returns a list of file/folder names from the root (excluded) down to and including the destination file or folder
        Throws:
        FileNotFoundException - if the node could not be found
      • resolveNamePath

        public FileInfo resolveNamePath​(org.alfresco.service.cmr.repository.NodeRef rootNodeRef,
                                        java.util.List<java.lang.String> pathElements)
                                 throws FileNotFoundException
        Description copied from interface: FileFolderService
        Resolve a file or folder name path from a given root node down to the final node.
        Specified by:
        resolveNamePath in interface FileFolderService
        Parameters:
        rootNodeRef - the start point node - a cm:folder type or subtype, e.g. the Company Home's nodeRef
        pathElements - a list of names in the path. Do not include the referenced rootNodeRef's path element.
        Returns:
        Returns the info of the file or folder
        Throws:
        FileNotFoundException - if no file or folder exists along the path
      • resolveNamePath

        public FileInfo resolveNamePath​(org.alfresco.service.cmr.repository.NodeRef rootNodeRef,
                                        java.util.List<java.lang.String> pathElements,
                                        boolean mustExist)
                                 throws FileNotFoundException
        Description copied from interface: FileFolderService
        Resolve a file or folder name path from a given root node down to the final node.
        Specified by:
        resolveNamePath in interface FileFolderService
        Parameters:
        rootNodeRef - the start point node - a cm:folder type or subtype, e.g. the Company Home's nodeRef
        pathElements - a list of names in the path. Do not include the referenced rootNodeRef's path element.
        Returns:
        Returns the info of the file or folder or null if mustExist is false and the file does not exist
        Throws:
        FileNotFoundException - if no file or folder exists along the path and mustExist is true
      • getFileInfo

        public FileInfo getFileInfo​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
        Description copied from interface: FileFolderService
        Get the file info (name, folder, etc) for the given node
        Specified by:
        getFileInfo in interface FileFolderService
        Parameters:
        nodeRef - the node to get info for
        Returns:
        Returns the file info or null if the node does not represent a file or folder
      • getReader

        public org.alfresco.service.cmr.repository.ContentReader getReader​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
        Description copied from interface: FileFolderService
        Get the reader to the file represented by the node according to the File/Folder model. (This is not the same as the method on the ContentService)
        Specified by:
        getReader in interface FileFolderService
        Parameters:
        nodeRef - the content node
        Returns:
        Returns a handle to the content associated with the node
      • getWriter

        public org.alfresco.service.cmr.repository.ContentWriter getWriter​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
        Description copied from interface: FileFolderService
        Get the writer to the file represented by the node according to the File/Folder model. (This is not the same as the method on the ContentService)
        Specified by:
        getWriter in interface FileFolderService
        Parameters:
        nodeRef - the content node
        Returns:
        Returns a handle to the content associated with the node
      • setHidden

        public void setHidden​(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                              boolean isHidden)
        Specified by:
        setHidden in interface FileFolderService
      • isHidden

        public boolean isHidden​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
        Specified by:
        isHidden in interface FileFolderService