/*
* Copyright (C) 2005-2014 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see
* 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 information from the root down to and including the node provided. *
null
if mustExist
is false
and the file does not exist
* @throws FileNotFoundException if no file or folder exists along the path and mustExist
is true
*/
@Auditable(parameters = {"rootNodeRef", "pathElements", "mustExist"})
public FileInfo resolveNamePath(NodeRef rootNodeRef, List