Package: ReferralException
ReferralException
name | instruction | branch | complexity | line | method | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ReferralException(String, String) |
|
|
|
|
|
||||||||||||||||||||
getText() |
|
|
|
|
|
||||||||||||||||||||
getUrl() |
|
|
|
|
|
Coverage
1: /*
2: * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved.
3: *
4: * This program and the accompanying materials are made available under the
5: * terms of the Eclipse Public License v. 2.0, which is available at
6: * http://www.eclipse.org/legal/epl-2.0.
7: *
8: * This Source Code may also be made available under the following Secondary
9: * Licenses when the conditions for such availability set forth in the
10: * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11: * version 2 with the GNU Classpath Exception, which is available at
12: * https://www.gnu.org/software/classpath/license.html.
13: *
14: * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15: */
16:
17: package org.eclipse.angus.mail.imap;
18:
19: import jakarta.mail.AuthenticationFailedException;
20:
21: /**
22: * A special kind of AuthenticationFailedException that indicates that
23: * the reason for the failure was an IMAP REFERRAL in the response code.
24: * See <a href="http://www.ietf.org/rfc/rfc2221.txt">RFC 2221</a> for details.
25: *
26: * @since JavaMail 1.5.5
27: */
28:
29: public class ReferralException extends AuthenticationFailedException {
30:
31: private String url;
32: private String text;
33:
34: private static final long serialVersionUID = -3414063558596287683L;
35:
36: /**
37: * Constructs an ReferralException with the specified URL and text.
38: *
39: * @param text        the detail message
40: * @param url        the URL
41: */
42: public ReferralException(String url, String text) {
43:         super("[REFERRAL " + url + "] " + text);
44:         this.url = url;
45:         this.text = text;
46: }
47:
48: /**
49: * Return the IMAP URL in the referral.
50: *
51: * @return        the IMAP URL
52: */
53: public String getUrl() {
54:         return url;
55: }
56:
57: /**
58: * Return the text sent by the server along with the referral.
59: *
60: * @return        the text
61: */
62: public String getText() {
63:         return text;
64: }
65: }