KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > slide > webdav > util > PreconditionViolationException


1 /*
2  * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/PreconditionViolationException.java,v 1.6 2004/07/28 09:32:08 ib Exp $
3  * $Revision: 1.6 $
4  * $Date: 2004/07/28 09:32:08 $
5  *
6  * ====================================================================
7  *
8  * Copyright 1999-2002 The Apache Software Foundation
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */

23 package org.apache.slide.webdav.util;
24
25 // import list
26
import org.apache.slide.webdav.WebdavException;
27
28 /**
29  * This exception is thrown due to a violated precondition.
30  *
31  * @version $Revision: 1.6 $
32  *
33  **/

34 public class PreconditionViolationException extends WebdavException {
35     
36     /**
37      * The precondition that has been violated.
38      */

39     protected ViolatedPrecondition violatedPrecondition = null;
40     
41     /**
42      * The URI of the resource associated with the precondition violation.
43      */

44     protected String JavaDoc objectUri = null;
45     
46     
47     /**
48      * Creates a PreconditionViolationException.
49      *
50      * @param violatedPrecondition the precondition that has been violated.
51      * @param objectUri the URI of the resource associated with
52      * the precondition violation.
53      */

54     public PreconditionViolationException(ViolatedPrecondition violatedPrecondition,
55                                          String JavaDoc objectUri) {
56         super(violatedPrecondition.getStatusCode());
57         this.violatedPrecondition = violatedPrecondition;
58         this.objectUri = objectUri;
59     }
60     
61     /**
62      * Returns the precondition that has been violated.
63      *
64      * @return precondition that has been violated.
65      */

66     public ViolatedPrecondition getViolatedPrecondition() {
67         return violatedPrecondition;
68     }
69     
70     /**
71      * Returns the URI of the resource associated with the precondition violation.
72      *
73      * @return the URI of the resource associated with the precondition violation.
74      */

75     public String JavaDoc getObjectUri() {
76         return objectUri;
77     }
78     
79 }
80
81
Popular Tags