Class FileFolderUtil

java.lang.Object
org.alfresco.service.cmr.model.FileFolderUtil

public class FileFolderUtil extends Object
Higher level utility methods to be used in conjunction with the FileFolderService.
Author:
mrogers
  • Constructor Details

    • FileFolderUtil

      public FileFolderUtil()
  • Method Details

    • makeFolders

      public static FileInfo makeFolders(FileFolderService service, NodeRef parentNodeRef, List<String> pathElements, 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, NodeRef parentNodeRef, List<String> pathElements, QName folderTypeQName, BehaviourFilter behaviourFilter, Set<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, NodeService nodeService, NodeRef parentNodeRef, List<FileFolderUtil.PathElementDetails> pathElementDetails, QName folderTypeQName, BehaviourFilter behaviourFilter, Set<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, NodeService nodeService, NodeRef parentNodeRef, List<FileFolderUtil.PathElementDetails> pathElementDetails, QName folderTypeQName, BehaviourFilter behaviourFilter, Set<QName> parentBehavioursToDisable, Set<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.