James Moger
2012-11-06 798581cab5817310a1b9991dac3b10cd7813f86a
commit | author | age
f13c4c 1 /*
JM 2  * Copyright 2011 gitblit.com.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
166e6a 16 package com.gitblit;
JM 17
31abc2 18 import java.io.IOException;
JM 19
892570 20 /**
88598b 21  * GitBlitException is a marginally useful class. :)
892570 22  * 
JM 23  * @author James Moger
88598b 24  * 
892570 25  */
31abc2 26 public class GitBlitException extends IOException {
166e6a 27
JM 28     private static final long serialVersionUID = 1L;
29
30     public GitBlitException(String message) {
31         super(message);
32     }
31abc2 33
c75304 34     public GitBlitException(Throwable cause) {
JM 35         super(cause);
36     }
37
31abc2 38     /**
JM 39      * Exception to indicate that the client should prompt for credentials
40      * because the requested action requires authentication.
41      */
42     public static class UnauthorizedException extends GitBlitException {
43
44         private static final long serialVersionUID = 1L;
45
46         public UnauthorizedException(String message) {
47             super(message);
48         }
49     }
50
51     /**
52      * Exception to indicate that the requested action can not be executed by
53      * the specified user.
54      */
55     public static class ForbiddenException extends GitBlitException {
56
57         private static final long serialVersionUID = 1L;
58
59         public ForbiddenException(String message) {
60             super(message);
61         }
62     }
8b7636 63
JM 64     /**
65      * Exception to indicate that the requested action has been disabled on the
66      * Gitblit server.
67      */
68     public static class NotAllowedException extends GitBlitException {
69
70         private static final long serialVersionUID = 1L;
71
72         public NotAllowedException(String message) {
73             super(message);
74         }
75     }
76
b2fde8 77     /**
JM 78      * Exception to indicate that the requested action can not be executed by
79      * the server because it does not recognize the request type.
80      */
81     public static class UnknownRequestException extends GitBlitException {
82
83         private static final long serialVersionUID = 1L;
84
85         public UnknownRequestException(String message) {
86             super(message);
87         }
88     }
166e6a 89 }