* 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(parameters = {"sourceNodeRef", "targetParentRef", "newName"}) public FileInfo move(NodeRef sourceNodeRef, NodeRef targetParentRef, String newName) throws FileExistsException, FileNotFoundException; /** * 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. * * @param sourceNodeRef the file or folder to move * @param sourceParentRef the source parent of node - null means move from primary parent * @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(parameters = { "sourceNodeRef", "sourceParentRef", "targetParentRef", "newName" }) public FileInfo moveFrom(NodeRef sourceNodeRef, NodeRef sourceParentRef, NodeRef targetParentRef, String newName) throws FileExistsException, FileNotFoundException; /** * @deprecated From 3.4.2, use {@link #moveFrom(NodeRef, NodeRef, NodeRef, String)} or * {@link #move(NodeRef, NodeRef, String)}. See * ALF-7692 */ @Auditable(parameters = { "sourceNodeRef", "sourceParentRef", "targetParentRef", "newName" }) public FileInfo move(NodeRef sourceNodeRef, NodeRef sourceParentRef, 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(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(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(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(parameters = {"nodeRef"}) public void delete(NodeRef nodeRef); /** * Get the file or folder names from the root down to and including the node provided. *