* If both the parent folder and name remain the same, then nothing is done. * * @param sourceNodeRef the file or folder to move * @param targetParentRef the new parent node to move the node to - null means rename in situ * @param newName the name to change the file or folder to - null to keep the existing name * @return Returns the new file info * @throws FileExistsException * @throws FileNotFoundException */ @Auditable(key = Auditable.Key.ARG_0, parameters = {"sourceNodeRef", "targetParentRef", "newName"}) public FileInfo move(NodeRef sourceNodeRef, NodeRef targetParentRef, String newName) throws FileExistsException, FileNotFoundException; /** * Copy a source file or folder. The source can be optionally renamed and optionally * moved into another folder. *
* If both the parent folder and name remain the same, then nothing is done. * * @param sourceNodeRef the file or folder to copy * @param targetParentRef the new parent node to copy the node to - null means rename in situ * @param newName the new name, or null to keep the existing name. * @return Return the new file info * @throws FileExistsException * @throws FileNotFoundException */ @Auditable(key = Auditable.Key.ARG_0, parameters = {"sourceNodeRef", "targetParentRef", "newName"}) public FileInfo copy(NodeRef sourceNodeRef, NodeRef targetParentRef, String newName) throws FileExistsException, FileNotFoundException; /** * 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. * * @param parentNodeRef the parent node. The parent must be a valid * {@link org.alfresco.model.ContentModel#TYPE_FOLDER folder}. * @param name the name of the node * @param typeQName the type to create * @return Returns the new node's file information * @throws FileExistsException * * @see {@link #create(NodeRef, String, QName, QName)} */ @Auditable(key = Auditable.Key.ARG_0, parameters = {"parentNodeRef", "name", "typeQName"}) public FileInfo create(NodeRef parentNodeRef, String name, QName typeQName) throws FileExistsException; /** * Create a file or folder; or any valid node of type derived from file or folder * * @param parentNodeRef the parent node. The parent must be a valid * {@link org.alfresco.model.ContentModel#TYPE_FOLDER folder}. * @param name the name of the node * @param typeQName the type to create * @param assocQName the association QName to set for the path (may be null). * @return Returns the new node's file information * @throws FileExistsException */ @Auditable(key = Auditable.Key.ARG_0, parameters = {"parentNodeRef", "name", "typeQName"}) public FileInfo create(NodeRef parentNodeRef, String name, QName typeQName, QName assocQName) throws FileExistsException; /** * Delete a file or folder * * @param nodeRef the node to delete */ @Auditable(key = Auditable.Key.ARG_0, parameters = {"nodeRef"}) public void delete(NodeRef nodeRef); /** * 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.
*
* @param parentNodeRef the node under which the path will be created
* @param pathElements the folder name path to create - may not be empty
* @param folderTypeQName the types of nodes to create. This must be a valid subtype of
* {@link org.alfresco.model.ContentModel#TYPE_FOLDER they folder type}.
* @return Returns the info of the last folder in the path.
*
* @deprecated - See the static helper method FileFolderServiceImpl.makeFolders
*/
@Auditable(key = Auditable.Key.ARG_0, parameters = {"parentNodeRef", "pathElements", "folderTypeQName"})
public FileInfo makeFolders(NodeRef parentNodeRef, List
*
*
* @param rootNodeRef the start of the returned path, or null if the store root
* node must be assumed.
* @param nodeRef a reference to the file or folder
* @return 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
*/
@Auditable(key = Auditable.Key.ARG_0, parameters = {"rootNodeRef", "nodeRef"})
public List