1 /*
2 * Copyright (C) 2009-2010, Google Inc. and others
3 *
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Distribution License v. 1.0 which is available at
6 * https://www.eclipse.org/org/documents/edl-v10.php.
7 *
8 * SPDX-License-Identifier: BSD-3-Clause
9 */
10
11 package org.eclipse.jgit.transport.resolver;
12
13 import org.eclipse.jgit.internal.JGitText;
14
15 /**
16 * Indicates that the requested service requires authentication that
17 * the current user has not provided.
18 * <p>
19 * This corresponds to response code
20 * {@code HttpServletResponse.SC_UNAUTHORIZED}.
21 */
22 public class ServiceNotAuthorizedException extends Exception {
23 private static final long serialVersionUID = 1L;
24
25 /**
26 * Constructor for ServiceNotAuthorizedException.
27 *
28 * @param message
29 * error message
30 * @param cause
31 * a {@link java.lang.Throwable} object.
32 * @since 4.1
33 */
34 public ServiceNotAuthorizedException(String message, Throwable cause) {
35 super(message, cause);
36 }
37
38 /**
39 * Constructor for ServiceNotAuthorizedException.
40 *
41 * @param message
42 * error message
43 * @since 4.1
44 */
45 public ServiceNotAuthorizedException(String message) {
46 super(message);
47 }
48
49 /**
50 * Indicates that the requested service requires authentication.
51 */
52 public ServiceNotAuthorizedException() {
53 super(JGitText.get().unauthorized);
54 }
55 }