Class FileFolderUtil


  • public class FileFolderUtil
    extends java.lang.Object
    Higher level utility methods to be used in conjunction with the FileFolderService.
    Author:
    mrogers
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  FileFolderUtil.PathElementDetails
      A simple POJO to hold information about the folder which will be created.
    • Constructor Summary

      Constructors 
      Constructor Description
      FileFolderUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      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)
      Checks for the presence of, and creates as necessary, the folder structure in the provided path.
      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, BehaviourFilter behaviourFilter, java.util.Set<org.alfresco.service.namespace.QName> parentBehavioursToDisable)
      Same as above, with option to disable parent behaviour(s) when creating sub-folder
      static FileInfo makeFolders​(FileFolderService service, org.alfresco.service.cmr.repository.NodeService nodeService, org.alfresco.service.cmr.repository.NodeRef parentNodeRef, java.util.List<FileFolderUtil.PathElementDetails> pathElementDetails, org.alfresco.service.namespace.QName folderTypeQName, BehaviourFilter behaviourFilter, java.util.Set<org.alfresco.service.namespace.QName> parentBehavioursToDisable)
      Checks for the presence of, and creates as necessary, the folder structure in the provided paths with the following options: Option to disable parent behaviour(s) when creating sub-folder. Each folder has the option to have its own set of aspects
      static FileInfo makeFolders​(FileFolderService service, org.alfresco.service.cmr.repository.NodeService nodeService, org.alfresco.service.cmr.repository.NodeRef parentNodeRef, java.util.List<FileFolderUtil.PathElementDetails> pathElementDetails, org.alfresco.service.namespace.QName folderTypeQName, BehaviourFilter behaviourFilter, java.util.Set<org.alfresco.service.namespace.QName> parentBehavioursToDisable, java.util.Set<org.alfresco.service.cmr.repository.NodeRef> allFoldersRefsInThePath)
      Checks for the presence of, and creates as necessary, the folder structure in the provided paths with the following options: Option to disable parent behaviour(s) when creating sub-folder. Each folder has the option to have its own set of aspects
      • Methods inherited from class java.lang.Object

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

      • FileFolderUtil

        public FileFolderUtil()
    • Method Detail

      • 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)
        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,
                                           BehaviourFilter behaviourFilter,
                                           java.util.Set<org.alfresco.service.namespace.QName> parentBehavioursToDisable)
        Same as above, with option to disable parent behaviour(s) when creating sub-folder
        Parameters:
        service - FileFolderService
        parentNodeRef - NodeRef
        folderTypeQName - QName
        behaviourFilter - BehaviourFilter
        Returns:
        FileInfo
      • makeFolders

        public static FileInfo makeFolders​(FileFolderService service,
                                           org.alfresco.service.cmr.repository.NodeService nodeService,
                                           org.alfresco.service.cmr.repository.NodeRef parentNodeRef,
                                           java.util.List<FileFolderUtil.PathElementDetails> pathElementDetails,
                                           org.alfresco.service.namespace.QName folderTypeQName,
                                           BehaviourFilter behaviourFilter,
                                           java.util.Set<org.alfresco.service.namespace.QName> parentBehavioursToDisable)
        Checks for the presence of, and creates as necessary, the folder structure in the provided paths with the following options:
        • Option to disable parent behaviour(s) when creating sub-folder.
        • Each folder has the option to have its own set of aspects
        Parameters:
        service - the FileFolderService object
        nodeService - the NodeService object
        parentNodeRef - the node under which the path will be created
        pathElementDetails - the list of folder hierarchy where each folder can have its own set of aspects - may not be empty
        folderTypeQName - the types of nodes to create. This must be a valid subtype of they folder type
        behaviourFilter - the BehaviourFilter object
        parentBehavioursToDisable - the set of behaviours that must be disabled
        Returns:
        Returns the FileInfo of the last folder in the path.
      • makeFolders

        public static FileInfo makeFolders​(FileFolderService service,
                                           org.alfresco.service.cmr.repository.NodeService nodeService,
                                           org.alfresco.service.cmr.repository.NodeRef parentNodeRef,
                                           java.util.List<FileFolderUtil.PathElementDetails> pathElementDetails,
                                           org.alfresco.service.namespace.QName folderTypeQName,
                                           BehaviourFilter behaviourFilter,
                                           java.util.Set<org.alfresco.service.namespace.QName> parentBehavioursToDisable,
                                           java.util.Set<org.alfresco.service.cmr.repository.NodeRef> allFoldersRefsInThePath)
        Checks for the presence of, and creates as necessary, the folder structure in the provided paths with the following options:
        • Option to disable parent behaviour(s) when creating sub-folder.
        • Each folder has the option to have its own set of aspects
        Parameters:
        service - the FileFolderService object
        nodeService - the NodeService object
        parentNodeRef - the node under which the path will be created
        pathElementDetails - the list of folder hierarchy where each folder can have its own set of aspects - may not be empty
        folderTypeQName - the types of nodes to create. This must be a valid subtype of they folder type
        behaviourFilter - the BehaviourFilter object
        parentBehavioursToDisable - the set of behaviours that must be disabled
        allFoldersRefsInThePath - (Optional) if an instance of a Set is provided, then it'd be populated with nodeRefs of all the folders that have been specified in the path elements details.(pathElementDetails).
        Returns:
        Returns the FileInfo of the last folder in the path.