2 * This document is a part of the source code and related artifacts
3 * for CollectionSpace, an open source collections management system
4 * for museums and related institutions:
6 * http://www.collectionspace.org
7 * http://wiki.collectionspace.org
9 * Copyright 2009 University of California at Berkeley
11 * Licensed under the Educational Community License (ECL), Version 2.0.
12 * You may not use this file except in compliance with this License.
14 * You may obtain a copy of the ECL 2.0 License at
16 * https://source.collectionspace.org/collection-space/LICENSE.txt
18 package org.collectionspace.services.common.document;
21 * DocumentNotFoundException
24 public class DocumentNotFoundException extends DocumentException {
26 final public static int HTTP_CODE = 404;
29 * Creates a new instance of <code>DocumentNotFoundException</code> without detail message.
31 public DocumentNotFoundException() {
32 setErrorCode(HTTP_CODE);
36 * Constructs an instance of <code>DocumentNotFoundException</code> with the specified detail message.
37 * @param msg the detail message.
39 public DocumentNotFoundException(String msg) {
41 setErrorCode(HTTP_CODE);
45 * Constructs a new exception with the specified detail message and
46 * cause. <p>Note that the detail message associated with
47 * <code>cause</code> is <i>not</i> automatically incorporated in
48 * this exception's detail message.
50 * @param message the detail message (which is saved for later retrieval
51 * by the {@link #getMessage()} method).
52 * @param cause the cause (which is saved for later retrieval by the
53 * {@link #getCause()} method). (A <tt>null</tt> value is
54 * permitted, and indicates that the cause is nonexistent or
58 public DocumentNotFoundException(String message, Throwable cause) {
59 super(message, cause);
60 setErrorCode(HTTP_CODE);
64 * Constructs a new exception with the specified cause and a detail
65 * message of <tt>(cause==null ? null : cause.toString())</tt> (which
66 * typically contains the class and detail message of <tt>cause</tt>).
67 * This constructor is useful for exceptions that are little more than
68 * wrappers for other throwables (for example, {@link
69 * java.security.PrivilegedActionException}).
71 * @param cause the cause (which is saved for later retrieval by the
72 * {@link #getCause()} method). (A <tt>null</tt> value is
73 * permitted, and indicates that the cause is nonexistent or
77 public DocumentNotFoundException(Throwable cause) {
79 setErrorCode(HTTP_CODE);