ServiceNotAuthorizedException.java

  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. package org.eclipse.jgit.transport.resolver;

  11. import org.eclipse.jgit.internal.JGitText;

  12. /**
  13.  * Indicates that the requested service requires authentication that
  14.  * the current user has not provided.
  15.  * <p>
  16.  * This corresponds to response code
  17.  * {@code HttpServletResponse.SC_UNAUTHORIZED}.
  18.  */
  19. public class ServiceNotAuthorizedException extends Exception {
  20.     private static final long serialVersionUID = 1L;

  21.     /**
  22.      * Constructor for ServiceNotAuthorizedException.
  23.      *
  24.      * @param message
  25.      *            error message
  26.      * @param cause
  27.      *            a {@link java.lang.Throwable} object.
  28.      * @since 4.1
  29.      */
  30.     public ServiceNotAuthorizedException(String message, Throwable cause) {
  31.         super(message, cause);
  32.     }

  33.     /**
  34.      * Constructor for ServiceNotAuthorizedException.
  35.      *
  36.      * @param message
  37.      *            error message
  38.      * @since 4.1
  39.      */
  40.     public ServiceNotAuthorizedException(String message) {
  41.         super(message);
  42.     }

  43.     /**
  44.      * Indicates that the requested service requires authentication.
  45.      */
  46.     public ServiceNotAuthorizedException() {
  47.         super(JGitText.get().unauthorized);
  48.     }
  49. }