From dcc266a41d1453e58bf748e4e2f926cf292f9a23 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Fri, 6 Jan 2023 23:08:10 +0100 Subject: [PATCH] Added not authorized HTTP status code. --- .../metrics/http/HttpStatusCategory.java | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/fr/devinsy/statoolinfos/metrics/http/HttpStatusCategory.java b/src/fr/devinsy/statoolinfos/metrics/http/HttpStatusCategory.java index cd0132a..686cd89 100644 --- a/src/fr/devinsy/statoolinfos/metrics/http/HttpStatusCategory.java +++ b/src/fr/devinsy/statoolinfos/metrics/http/HttpStatusCategory.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Christian Pierre MOMON + * Copyright (C) 2021-2022 Christian Pierre MOMON * * 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. *