Derek Hulley 4e4e342409 Merged DEV/CHECK_EXISTS to HEAD
svn merge svn://www.alfresco.org:3691/alfresco/BRANCHES/DEV/CHECK_EXISTS@3442 svn://www.alfresco.org:3691/alfresco/BRANCHES/DEV/CHECK_EXISTS@3590 .

TODO: Fix bug raising incorrect exception during UI paste of same-named file
Note:
- Added a new method to NodeService to get child by name
- Added a new method to FileFolderService to perform fast, direct lookups based on name


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3591 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2006-08-23 16:50:12 +00:00

53 lines
1.3 KiB
Java

/*
* Copyright (C) 2005 Alfresco, Inc.
*
* Licensed under the Mozilla Public License version 1.1
* with a permitted attribution clause. You may obtain a
* copy of the License at
*
* http://www.alfresco.org/legal/license.txt
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the
* License.
*/
package org.alfresco.service.cmr.model;
import org.alfresco.service.cmr.repository.NodeRef;
/**
* Common, checked exception thrown when an operation fails because
* of a name clash.
*
* @author Derek Hulley
*/
public class FileExistsException extends RuntimeException
{
private static final long serialVersionUID = -4133713912784624118L;
private NodeRef parentNodeRef;
private String name;
public FileExistsException(NodeRef parentNodeRef, String name)
{
super("Existing file or folder " +
name +
" already exists");
this.parentNodeRef = parentNodeRef;
this.name = name;
}
public NodeRef getParentNodeRef()
{
return parentNodeRef;
}
public String getName()
{
return name;
}
}