Package com.sun.mail.imap

# Class ReferralException

java.lang.Object
java.lang.Throwable
java.lang.Exception
javax.mail.MessagingException
javax.mail.AuthenticationFailedException
com.sun.mail.imap.ReferralException

All Implemented Interfaces:
  `Serializable`

public class ReferralException extends AuthenticationFailedException
A special kind of AuthenticationFailedException that indicates that the reason for the failure was an IMAP REFERRAL in the response code. See RFC 2221 for details.

Since:
  JavaMail 1.5.5
See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`ReferralException(String url, String text)`
Constructs an ReferralException with the specified URL and text.

## Method Summary

Modifier and Type
Method
Description
`String`
`getText()`
Return the text sent by the server along with the referral.
`String`
`getUrl()`
Return the IMAP URL in the referral.

### Methods inherited from class javax.mail.MessagingException

`getCause, getNextException, setNextException, toString`

### Methods inherited from class java.lang.Throwable

`addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### ReferralException

public ReferralException(String url, String text)
Constructs an ReferralException with the specified URL and text.

Parameters:
  `text` - the detail message
  `url` - the URL

## Method Details

### getUrl

public String getUrl()
Return the IMAP URL in the referral.

Returns:
  the IMAP URL

### getText

public String getText()
Return the text sent by the server along with the referral.

Returns:
  the text