]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
af15a9ad2913f082b11e831cede06823def46ffc
[tmp/jakarta-migration.git] /
1 /**
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:
5
6  *  http://www.collectionspace.org
7  *  http://wiki.collectionspace.org
8
9  *  Copyright 2009 University of California at Berkeley
10
11  *  Licensed under the Educational Community License (ECL), Version 2.0.
12  *  You may not use this file except in compliance with this License.
13
14  *  You may obtain a copy of the ECL 2.0 License at
15
16  *  https://source.collectionspace.org/collection-space/LICENSE.txt
17  */
18 package org.collectionspace.services.common.document;
19
20 /**
21  * DocumentNotFoundException
22  * 
23  */
24 public class DocumentNotFoundException extends DocumentException {
25
26     final public static int HTTP_CODE = 404;
27
28     /**
29      * Creates a new instance of <code>DocumentNotFoundException</code> without detail message.
30      */
31     public DocumentNotFoundException() {
32         setErrorCode(HTTP_CODE);
33     }
34
35     /**
36      * Constructs an instance of <code>DocumentNotFoundException</code> with the specified detail message.
37      * @param msg the detail message.
38      */
39     public DocumentNotFoundException(String msg) {
40         super(msg);
41         setErrorCode(HTTP_CODE);
42     }
43
44     /**
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.
49      *
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
55      *         unknown.)
56      * @since  1.4
57      */
58     public DocumentNotFoundException(String message, Throwable cause) {
59         super(message, cause);
60         setErrorCode(HTTP_CODE);
61     }
62
63     /**
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}).
70      *
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
74      *         unknown.)
75      * @since  1.4
76      */
77     public DocumentNotFoundException(Throwable cause) {
78         super(cause);
79         setErrorCode(HTTP_CODE);
80     }
81 }