Package org.alfresco.service.cmr.model
Class FileFolderUtil
java.lang.Object
org.alfresco.service.cmr.model.FileFolderUtil
Higher level utility methods to be used in conjunction with the FileFolderService.
- Author:
- mrogers
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA simple POJO to hold information about the folder which will be created. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FileInfomakeFolders(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.static FileInfomakeFolders(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-folderstatic FileInfomakeFolders(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 aspectsstatic FileInfomakeFolders(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
-
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 createdpathElements- the folder name path to create - may not be emptyfolderTypeQName- the types of nodes to create. This must be a valid subtype ofthey 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- FileFolderServiceparentNodeRef- NodeReffolderTypeQName- QNamebehaviourFilter- 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 objectnodeService- the NodeService objectparentNodeRef- the node under which the path will be createdpathElementDetails- the list of folder hierarchy where each folder can have its own set of aspects - may not be emptyfolderTypeQName- the types of nodes to create. This must be a valid subtype ofthey folder typebehaviourFilter- the BehaviourFilter objectparentBehavioursToDisable- the set of behaviours that must be disabled- Returns:
- Returns the
FileInfoof 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 objectnodeService- the NodeService objectparentNodeRef- the node under which the path will be createdpathElementDetails- the list of folder hierarchy where each folder can have its own set of aspects - may not be emptyfolderTypeQName- the types of nodes to create. This must be a valid subtype ofthey folder typebehaviourFilter- the BehaviourFilter objectparentBehavioursToDisable- the set of behaviours that must be disabledallFoldersRefsInThePath- (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
FileInfoof the last folder in the path.
-