Package org.apache.juneau.http.response
Class Unauthorized
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.apache.juneau.http.response.BasicHttpException
org.apache.juneau.http.response.Unauthorized
- All Implemented Interfaces:
Serializable,HttpResponseMessage
- Direct Known Subclasses:
AuthenticationException,Unauthorized.Unmodifiable
Represents an HTTP 401 Unauthorized error response.
Authentication is required and has failed or has not yet been provided.
See Also:
- Since:
- 9.2.1
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classUnmodifiable point-in-time snapshot of the enclosingUnauthorizedexception. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringReason phrasestatic final intHTTP status code -
Constructor Summary
ConstructorsConstructorDescriptionConstructor with no message.Unauthorized(String msg, Object... args) Constructor with aString.format-style message.Unauthorized(Throwable cause) Constructor with a cause.Unauthorized(Throwable cause, String msg, Object... args) Constructor with a cause and aString.format-style message.Unauthorized(Unauthorized copyFrom) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns an unmodifiable snapshot of this bean.Methods inherited from class org.apache.juneau.http.response.BasicHttpException
addHeader, addHeader, equals, freeze, getBody, getFullStackMessage, getHeaders, getLocale, getMessage, getRootCause, getStatusCode, getStatusLine, hashCode, isUnmodifiable, modify, setBody, setContent, setContent, setHeader, setHeader, setHeaders, setHeaders, setLocale, setProtocolVersion, setReasonPhrase, setStatusCode, setStatusLine, toStringMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTraceMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.juneau.http.response.HttpResponseMessage
getFirstHeader, getHeaders
-
Field Details
-
STATUS_CODE
HTTP status code- See Also:
-
REASON_PHRASE
Reason phrase- See Also:
-
-
Constructor Details
-
Unauthorized
public Unauthorized()Constructor with no message. -
Unauthorized
Constructor with aString.format-style message.- Parameters:
msg- The detail message. May benull . Treated as aString.format-style format string (%s placeholders) whenargsis non-empty.args- Optional message arguments.
-
Unauthorized
Constructor with a cause.- Parameters:
cause- The cause. May benull .
-
Unauthorized
Constructor with a cause and aString.format-style message.- Parameters:
cause- The cause. May benull .msg- The detail message. May benull . Treated as aString.format-style format string (%s placeholders) whenargsis non-empty.args- Optional message arguments.
-
Unauthorized
Copy constructor.- Parameters:
copyFrom- The instance to copy. Must not benull .
-
-
Method Details
-
unmodifiable
Description copied from class:BasicHttpExceptionReturns an unmodifiable snapshot of this bean.The returned instance is a point-in-time copy of the leaf's nested
Unmodifiabletype; any attempt to set a property on it throws anUnsupportedOperationException. This method is idempotent: if this bean is already unmodifiable it returns itself rather than taking another snapshot. The receiver is left unchanged (and still modifiable unless it was already unmodifiable).- Overrides:
unmodifiablein classBasicHttpException- Returns:
- An unmodifiable snapshot of this bean, or this bean if it is already unmodifiable.
-