Added not authorized HTTP status code.
This commit is contained in:
parent
999b61d3be
commit
dcc266a41d
1 changed files with 25 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2021 Christian Pierre MOMON <christian@momon.org>
|
||||
* Copyright (C) 2021-2022 Christian Pierre MOMON <christian@momon.org>
|
||||
*
|
||||
* This file is part of StatoolInfos, simple service statistics tool.
|
||||
*
|
||||
|
@ -75,6 +75,13 @@ public enum HttpStatusCategory
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if is success.
|
||||
*
|
||||
* @param httpCode
|
||||
* the http code
|
||||
* @return true, if is success
|
||||
*/
|
||||
public static boolean isSuccess(final int httpCode)
|
||||
{
|
||||
boolean result;
|
||||
|
@ -85,6 +92,23 @@ public enum HttpStatusCategory
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if is unauthorized.
|
||||
*
|
||||
* @param httpCode
|
||||
* the http code
|
||||
* @return true, if is unauthorized
|
||||
*/
|
||||
public static boolean isUnauthorized(final int httpCode)
|
||||
{
|
||||
boolean result;
|
||||
|
||||
result = (httpCode == 401);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Value of.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue