From 8ca626039a122e33f844609b0f78c1eda6436b03 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Wed, 14 Aug 2024 23:34:33 +0200 Subject: [PATCH] Removed useless logger variable. --- src/fr/devinsy/statoolinfos/cli/CLIUtils.java | 6 +----- src/fr/devinsy/statoolinfos/core/Metrics.java | 4 ---- src/fr/devinsy/statoolinfos/core/Service.java | 6 +----- .../statoolinfos/core/StatoolInfosUtils.java | 6 +----- src/fr/devinsy/statoolinfos/io/CSVFile.java | 4 ---- src/fr/devinsy/statoolinfos/io/CSVWriter.java | 6 +----- src/fr/devinsy/statoolinfos/io/JSONFile.java | 4 ---- src/fr/devinsy/statoolinfos/io/ODSFile.java | 5 ----- src/fr/devinsy/statoolinfos/io/ODSWriter.java | 6 +----- src/fr/devinsy/statoolinfos/metrics/Metric.java | 15 ++++++++++----- .../devinsy/statoolinfos/metrics/PathCounter.java | 5 ----- .../statoolinfos/metrics/StringCounter.java | 5 ----- src/fr/devinsy/statoolinfos/metrics/TimeMark.java | 7 +------ .../statoolinfos/metrics/TimeMarkUtils.java | 6 +----- .../metrics/etherpad/EtherpadHttpLogAnalyzer.java | 5 ----- .../metrics/etherpad/EtherpadLog.java | 5 ----- .../statoolinfos/metrics/gitea/GiteaAPI.java | 10 +++------- .../statoolinfos/metrics/gsl/GSLProber.java | 4 ---- .../metrics/httpaccess/HttpAccessLog.java | 5 ----- .../metrics/httpaccess/HttpAccessLogAnalyzer.java | 4 ---- .../metrics/httpaccess/HttpAccessLogParser.java | 9 --------- .../metrics/httpaccess/HttpAccessLogStat.java | 5 ----- .../metrics/httpaccess/HttpAccessLogs.java | 5 ----- .../metrics/httpaccess/HttpStatus.java | 5 ----- .../metrics/httpaccess/HttpStatusTable.java | 9 ++------- .../metrics/httpaccess/UserAgent.java | 4 ---- .../metrics/httpaccess/UserAgentBotDetector.java | 4 ---- .../statoolinfos/metrics/httpaccess/Visit.java | 6 +----- .../metrics/httperrorlog/HttpErrorLog.java | 5 ----- .../httperrorlog/HttpErrorLogAnalyzer.java | 4 ---- .../metrics/httperrorlog/HttpErrorLogParser.java | 5 ----- .../metrics/httperrorlog/HttpErrorLogs.java | 5 ----- .../statoolinfos/metrics/jitsi/JitsiProber.java | 5 ----- .../metrics/libreqr/LibreQRProber.java | 5 ----- .../metrics/minetest/MinetestLog.java | 7 +------ .../metrics/minetest/MinetestLogAnalyzer.java | 10 ++++++++++ .../metrics/mumble/MumbleDatabaseAnalyzer.java | 5 ----- .../statoolinfos/metrics/mumble/MumbleLog.java | 5 ----- .../metrics/mumble/MumbleLogAnalyzer.java | 10 ++++++++++ .../statoolinfos/metrics/mumble/MumbleProber.java | 5 ----- .../metrics/nextcloud/NextcloudDataAnalyzer.java | 4 ---- .../nextcloud/NextcloudHttpLogAnalyzer.java | 5 ----- .../metrics/nextcloud/NextcloudProber.java | 5 ----- .../metrics/privatebin/PrivatebinPatchLog.java | 5 ----- .../metrics/privatebin/PrivatebinProber.java | 4 ---- .../statoolinfos/metrics/util/DatabaseProber.java | 5 ----- .../metrics/util/DatafilesProber.java | 4 ---- .../metrics/xmpp/XmppDataAnalyzer.java | 4 ---- .../metrics/xmpp/XmppHttpLogAnalyzer.java | 5 ----- .../statoolinfos/metrics/xmpp/XmppProber.java | 5 ----- .../statoolinfos/properties/MetricDirectory.java | 5 ----- .../statoolinfos/properties/MetricSpecs.java | 3 +-- .../statoolinfos/properties/MonthValues.java | 1 - .../statoolinfos/properties/PathPropertySet.java | 5 ----- .../properties/PathPropertyUtils.java | 4 ---- .../statoolinfos/properties/YearValues.java | 1 - src/fr/devinsy/statoolinfos/stats/ip/IpStat.java | 5 ----- .../devinsy/statoolinfos/stats/ip/IpStatSet.java | 5 ----- .../devinsy/statoolinfos/stats/ip/IpStator.java | 5 ----- src/fr/devinsy/statoolinfos/stats/ip/IpStats.java | 4 ---- .../stats/properties/PropertyStats.java | 4 ---- .../statoolinfos/stats/useragent/IpSet.java | 4 ---- .../stats/useragent/UserAgentStat.java | 5 ----- .../stats/useragent/UserAgentStatSet.java | 5 ----- .../stats/useragent/UserAgentStator.java | 5 ----- .../stats/useragent/UserAgentStats.java | 4 ---- .../statoolinfos/stats/visitor/VisitorStat.java | 5 ----- .../stats/visitor/VisitorStatSet.java | 4 ---- .../statoolinfos/stats/visitor/VisitorStator.java | 5 ----- .../statoolinfos/stats/visitor/VisitorStats.java | 4 ---- .../statoolinfos/uptime/ServiceUptime.java | 5 ----- .../statoolinfos/uptime/ServiceUptimes.java | 4 ---- .../statoolinfos/uptime/ServiceUptimesFile.java | 5 ----- src/fr/devinsy/statoolinfos/uptime/URLSet.java | 5 ----- src/fr/devinsy/statoolinfos/uptime/URLs.java | 4 ---- src/fr/devinsy/statoolinfos/uptime/Uptime.java | 5 ----- .../statoolinfos/uptime/UptimeJournal.java | 5 ----- .../statoolinfos/uptime/UptimeJournalFile.java | 4 ---- src/fr/devinsy/statoolinfos/uptime/UptimeSet.java | 5 ----- .../devinsy/statoolinfos/uptime/UptimeStat.java | 5 ----- .../statoolinfos/uptime/UptimeSurveyor.java | 5 ----- src/fr/devinsy/statoolinfos/uptime/Uptimes.java | 4 ---- src/fr/devinsy/statoolinfos/util/IpUtils.java | 5 ----- .../devinsy/statoolinfos/util/LineIterator.java | 4 ---- .../devinsy/statoolinfos/util/sql/SQLUtils.java | 4 ---- .../statoolinfos/checker/PropertyCheckerTest.java | 3 ++- .../statoolinfos/core/StatoolInfosTest.java | 3 ++- .../httpaccess/HttpAccessLogIteratorTest.java | 5 ++--- .../httpaccess/HttpAccessLogParserTest.java | 2 -- .../httpaccess/HttpAccessLogsAnalyzerTest.java | 2 -- .../httpaccess/UserAgentBotDetectorTest.java | 3 ++- .../httperror/HttpErrorLogIteratorTest.java | 2 -- .../httperror/HttpErrorLogsAnalyzerTest.java | 2 -- 93 files changed, 53 insertions(+), 403 deletions(-) diff --git a/src/fr/devinsy/statoolinfos/cli/CLIUtils.java b/src/fr/devinsy/statoolinfos/cli/CLIUtils.java index c652010..e6ce426 100644 --- a/src/fr/devinsy/statoolinfos/cli/CLIUtils.java +++ b/src/fr/devinsy/statoolinfos/cli/CLIUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 Christian Pierre MOMON + * Copyright (C) 2020-2024 Christian Pierre MOMON * * This file is part of StatoolInfos, simple service statistics tool. * @@ -19,16 +19,12 @@ package fr.devinsy.statoolinfos.cli; import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * The Class CLIUtils. */ public final class CLIUtils { - private static Logger logger = LoggerFactory.getLogger(CLIUtils.class); - /** * Instantiates a new statool infos CLI. */ diff --git a/src/fr/devinsy/statoolinfos/core/Metrics.java b/src/fr/devinsy/statoolinfos/core/Metrics.java index b6f044a..9e44f06 100644 --- a/src/fr/devinsy/statoolinfos/core/Metrics.java +++ b/src/fr/devinsy/statoolinfos/core/Metrics.java @@ -23,8 +23,6 @@ import java.net.URL; import java.time.LocalDateTime; import org.apache.commons.io.FilenameUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import fr.devinsy.statoolinfos.checker.PropertyChecks; import fr.devinsy.statoolinfos.properties.PathProperties; @@ -37,8 +35,6 @@ public class Metrics extends PathPropertyList { private static final long serialVersionUID = -1608084706095266037L; - private static Logger logger = LoggerFactory.getLogger(Metrics.class); - private String localFileNamePrefix; private File inputFile; private URL inputURL; diff --git a/src/fr/devinsy/statoolinfos/core/Service.java b/src/fr/devinsy/statoolinfos/core/Service.java index 46b03a2..fb301b8 100644 --- a/src/fr/devinsy/statoolinfos/core/Service.java +++ b/src/fr/devinsy/statoolinfos/core/Service.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Christian Pierre MOMON + * Copyright (C) 2020-2024 Christian Pierre MOMON * * This file is part of StatoolInfos, simple service statistics tool. * @@ -27,8 +27,6 @@ import java.time.YearMonth; import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import fr.devinsy.statoolinfos.checker.PropertyChecks; import fr.devinsy.statoolinfos.crawl.CrawlJournal; @@ -45,8 +43,6 @@ public class Service extends PathPropertyList { private static final long serialVersionUID = 3629841771102288863L; - private static Logger logger = LoggerFactory.getLogger(Service.class); - public enum HostProviderType { HOME, diff --git a/src/fr/devinsy/statoolinfos/core/StatoolInfosUtils.java b/src/fr/devinsy/statoolinfos/core/StatoolInfosUtils.java index aec7603..ce4cbe6 100644 --- a/src/fr/devinsy/statoolinfos/core/StatoolInfosUtils.java +++ b/src/fr/devinsy/statoolinfos/core/StatoolInfosUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2022 Christian Pierre MOMON + * Copyright (C) 2020-2024 Christian Pierre MOMON * * This file is part of StatoolInfos, simple service statistics tool. * @@ -50,8 +50,6 @@ import org.apache.tika.Tika; import org.apache.tika.mime.MimeType; import org.apache.tika.mime.MimeTypeException; import org.apache.tika.mime.MimeTypes; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import fr.devinsy.strings.StringList; import fr.devinsy.strings.StringsUtils; @@ -61,8 +59,6 @@ import fr.devinsy.strings.StringsUtils; */ public class StatoolInfosUtils { - private static Logger logger = LoggerFactory.getLogger(StatoolInfosUtils.class); - public static final DateTimeFormatter PATTERN_SHORTDATE = DateTimeFormatter.ofPattern("dd/MM/yyyy", Locale.FRANCE); public static final DateTimeFormatter PATTERN_LONGDATE = DateTimeFormatter.ofPattern("dd/MM/yyyy HH':'mm", Locale.FRANCE); diff --git a/src/fr/devinsy/statoolinfos/io/CSVFile.java b/src/fr/devinsy/statoolinfos/io/CSVFile.java index d291d51..216fff5 100644 --- a/src/fr/devinsy/statoolinfos/io/CSVFile.java +++ b/src/fr/devinsy/statoolinfos/io/CSVFile.java @@ -22,8 +22,6 @@ import java.io.File; import java.io.IOException; import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import fr.devinsy.statoolinfos.core.Categories; import fr.devinsy.statoolinfos.core.Organization; @@ -39,8 +37,6 @@ import fr.devinsy.strings.StringSet; */ public class CSVFile { - private static final Logger logger = LoggerFactory.getLogger(CSVFile.class); - public static final int MAX_LINE_SIZE = 4096; public static final String SEPARATOR = ";"; diff --git a/src/fr/devinsy/statoolinfos/io/CSVWriter.java b/src/fr/devinsy/statoolinfos/io/CSVWriter.java index c66e03f..d73e377 100644 --- a/src/fr/devinsy/statoolinfos/io/CSVWriter.java +++ b/src/fr/devinsy/statoolinfos/io/CSVWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2023 Christian Pierre MOMON + * Copyright (C) 2021-2024 Christian Pierre MOMON * * This file is part of StatoolInfos, simple service statistics tool. * @@ -29,16 +29,12 @@ import java.nio.charset.StandardCharsets; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * The Class CSVWriter. */ public class CSVWriter implements SpreadsheetWriter { - private static final Logger logger = LoggerFactory.getLogger(CSVWriter.class); - private char separator; private PrintWriter out; private boolean isNewline; diff --git a/src/fr/devinsy/statoolinfos/io/JSONFile.java b/src/fr/devinsy/statoolinfos/io/JSONFile.java index 301e538..d27722c 100644 --- a/src/fr/devinsy/statoolinfos/io/JSONFile.java +++ b/src/fr/devinsy/statoolinfos/io/JSONFile.java @@ -24,8 +24,6 @@ import java.io.UnsupportedEncodingException; import org.apache.commons.lang3.StringUtils; import org.apache.commons.text.StringEscapeUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import fr.devinsy.statoolinfos.core.Categories; import fr.devinsy.statoolinfos.core.Federation; @@ -43,8 +41,6 @@ import fr.devinsy.strings.StringsUtils; */ public class JSONFile { - private static final Logger logger = LoggerFactory.getLogger(JSONFile.class); - /** * Escape. * diff --git a/src/fr/devinsy/statoolinfos/io/ODSFile.java b/src/fr/devinsy/statoolinfos/io/ODSFile.java index abf8899..05e6342 100644 --- a/src/fr/devinsy/statoolinfos/io/ODSFile.java +++ b/src/fr/devinsy/statoolinfos/io/ODSFile.java @@ -21,9 +21,6 @@ package fr.devinsy.statoolinfos.io; import java.io.File; import java.io.IOException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import fr.devinsy.statoolinfos.core.Categories; import fr.devinsy.statoolinfos.core.Organizations; import fr.devinsy.statoolinfos.core.Services; @@ -33,8 +30,6 @@ import fr.devinsy.statoolinfos.core.Services; */ public class ODSFile { - private static final Logger logger = LoggerFactory.getLogger(ODSFile.class); - public static final int MAX_LINE_SIZE = 1024; protected enum Status diff --git a/src/fr/devinsy/statoolinfos/io/ODSWriter.java b/src/fr/devinsy/statoolinfos/io/ODSWriter.java index d7ee475..5590509 100644 --- a/src/fr/devinsy/statoolinfos/io/ODSWriter.java +++ b/src/fr/devinsy/statoolinfos/io/ODSWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Christian Pierre MOMON + * Copyright (C) 2021-2024 Christian Pierre MOMON * * This file is part of StatoolInfos, simple service statistics tool. * @@ -28,16 +28,12 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import org.jopendocument.dom.spreadsheet.Sheet; import org.jopendocument.dom.spreadsheet.SpreadSheet; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * The Class ODSWriter. */ public class ODSWriter implements SpreadsheetWriter { - private static final Logger logger = LoggerFactory.getLogger(ODSWriter.class); - private File file; private SpreadSheet workbook; private Sheet currentSheet; diff --git a/src/fr/devinsy/statoolinfos/metrics/Metric.java b/src/fr/devinsy/statoolinfos/metrics/Metric.java index d400457..579d4fa 100644 --- a/src/fr/devinsy/statoolinfos/metrics/Metric.java +++ b/src/fr/devinsy/statoolinfos/metrics/Metric.java @@ -20,9 +20,6 @@ package fr.devinsy.statoolinfos.metrics; import java.time.YearMonth; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import fr.devinsy.statoolinfos.properties.MonthValues; import fr.devinsy.strings.StringList; @@ -31,8 +28,6 @@ import fr.devinsy.strings.StringList; */ public class Metric { - private static Logger logger = LoggerFactory.getLogger(Metric.class); - public enum Type { MONTHS, @@ -113,6 +108,16 @@ public class Metric return this.name; } + /** + * Gets the path. + * + * @return the path + */ + public String getPath() + { + return this.path; + } + /** * Gets the start year. * diff --git a/src/fr/devinsy/statoolinfos/metrics/PathCounter.java b/src/fr/devinsy/statoolinfos/metrics/PathCounter.java index 7959a05..3d6c19e 100644 --- a/src/fr/devinsy/statoolinfos/metrics/PathCounter.java +++ b/src/fr/devinsy/statoolinfos/metrics/PathCounter.java @@ -18,16 +18,11 @@ */ package fr.devinsy.statoolinfos.metrics; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * The Class PathCounter. */ public class PathCounter { - private static Logger logger = LoggerFactory.getLogger(PathCounter.class); - private String path; private String timeMark; private long counter; diff --git a/src/fr/devinsy/statoolinfos/metrics/StringCounter.java b/src/fr/devinsy/statoolinfos/metrics/StringCounter.java index 5b20caa..4cfb2c7 100644 --- a/src/fr/devinsy/statoolinfos/metrics/StringCounter.java +++ b/src/fr/devinsy/statoolinfos/metrics/StringCounter.java @@ -18,16 +18,11 @@ */ package fr.devinsy.statoolinfos.metrics; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * The Class StringCounter. */ public class StringCounter { - private static Logger logger = LoggerFactory.getLogger(StringCounter.class); - private String string; private long counter; diff --git a/src/fr/devinsy/statoolinfos/metrics/TimeMark.java b/src/fr/devinsy/statoolinfos/metrics/TimeMark.java index 54a100c..10c0d1e 100644 --- a/src/fr/devinsy/statoolinfos/metrics/TimeMark.java +++ b/src/fr/devinsy/statoolinfos/metrics/TimeMark.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 Christian Pierre MOMON + * Copyright (C) 2021-2024 Christian Pierre MOMON * * This file is part of StatoolInfos, simple service statistics tool. * @@ -25,16 +25,11 @@ import java.time.format.DateTimeFormatter; import java.util.Locale; import java.util.regex.Matcher; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * The Class TimeMark. */ public class TimeMark { - private static Logger logger = LoggerFactory.getLogger(TimeMark.class); - private String value; /** diff --git a/src/fr/devinsy/statoolinfos/metrics/TimeMarkUtils.java b/src/fr/devinsy/statoolinfos/metrics/TimeMarkUtils.java index 298c6fa..01dadad 100644 --- a/src/fr/devinsy/statoolinfos/metrics/TimeMarkUtils.java +++ b/src/fr/devinsy/statoolinfos/metrics/TimeMarkUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 Christian Pierre MOMON + * Copyright (C) 2022-2024 Christian Pierre MOMON * * This file is part of StatoolInfos, simple service statistics tool. * @@ -26,8 +26,6 @@ import java.time.format.DateTimeFormatter; import java.util.Locale; import java.util.regex.Pattern; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.threeten.extra.YearWeek; /** @@ -35,8 +33,6 @@ import org.threeten.extra.YearWeek; */ public class TimeMarkUtils { - private static Logger logger = LoggerFactory.getLogger(TimeMarkUtils.class); - public static final Pattern YEAR_PATTERN = Pattern.compile("^(?\\d{4})$"); public static final Pattern YEAR_MONTH_PATTERN = Pattern.compile("^(?\\d{4})-(?\\d{2})$"); public static final Pattern YEAR_WEEK_PATTERN = Pattern.compile("^(?\\d{4})-W(?\\d{2})$"); diff --git a/src/fr/devinsy/statoolinfos/metrics/etherpad/EtherpadHttpLogAnalyzer.java b/src/fr/devinsy/statoolinfos/metrics/etherpad/EtherpadHttpLogAnalyzer.java index 1aa77f1..b2fecb7 100644 --- a/src/fr/devinsy/statoolinfos/metrics/etherpad/EtherpadHttpLogAnalyzer.java +++ b/src/fr/devinsy/statoolinfos/metrics/etherpad/EtherpadHttpLogAnalyzer.java @@ -21,9 +21,6 @@ package fr.devinsy.statoolinfos.metrics.etherpad; import java.io.IOException; import java.util.regex.Pattern; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import fr.devinsy.statoolinfos.core.StatoolInfosException; import fr.devinsy.statoolinfos.metrics.PathCounters; import fr.devinsy.statoolinfos.metrics.UserCounters; @@ -35,8 +32,6 @@ import fr.devinsy.statoolinfos.metrics.httpaccess.HttpAccessLogs; */ public class EtherpadHttpLogAnalyzer { - private static Logger logger = LoggerFactory.getLogger(EtherpadHttpLogAnalyzer.class); - public static final Pattern USE_PATTERN = Pattern.compile("^GET /p/\\S+ .*$"); private PathCounters counters; diff --git a/src/fr/devinsy/statoolinfos/metrics/etherpad/EtherpadLog.java b/src/fr/devinsy/statoolinfos/metrics/etherpad/EtherpadLog.java index d8bc714..2329413 100644 --- a/src/fr/devinsy/statoolinfos/metrics/etherpad/EtherpadLog.java +++ b/src/fr/devinsy/statoolinfos/metrics/etherpad/EtherpadLog.java @@ -22,9 +22,6 @@ import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.Locale; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import fr.devinsy.statoolinfos.metrics.TimeMark; import fr.devinsy.statoolinfos.metrics.TimeMarkUtils; import fr.devinsy.strings.StringList; @@ -34,8 +31,6 @@ import fr.devinsy.strings.StringList; */ public class EtherpadLog { - private static Logger logger = LoggerFactory.getLogger(EtherpadLog.class); - private LocalDateTime time; private String level; private String type; diff --git a/src/fr/devinsy/statoolinfos/metrics/gitea/GiteaAPI.java b/src/fr/devinsy/statoolinfos/metrics/gitea/GiteaAPI.java index db8dbb0..8cd5516 100644 --- a/src/fr/devinsy/statoolinfos/metrics/gitea/GiteaAPI.java +++ b/src/fr/devinsy/statoolinfos/metrics/gitea/GiteaAPI.java @@ -31,16 +31,12 @@ import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * The Class GiteaAPI. */ public class GiteaAPI { - private static Logger logger = LoggerFactory.getLogger(GiteaAPI.class); - private String url; private String token; private JSONArray users; @@ -67,15 +63,15 @@ public class GiteaAPI this.token = token; // - String json = IOUtils.toString(new URL(this.url + "/api/v1/admin/users?limit=100000&token=" + token), Charset.defaultCharset()); + String json = IOUtils.toString(new URL(this.url + "/api/v1/admin/users?limit=100000&token=" + this.token), Charset.defaultCharset()); this.users = (JSONArray) (new JSONParser().parse(json)); // - json = IOUtils.toString(new URL(this.url + "/api/v1/admin/orgs?limit=100000&token=" + token), Charset.defaultCharset()); + json = IOUtils.toString(new URL(this.url + "/api/v1/admin/orgs?limit=100000&token=" + this.token), Charset.defaultCharset()); this.organizations = (JSONArray) (new JSONParser().parse(json)); // - json = IOUtils.toString(new URL(this.url + "/api/v1/repos/search?limit=100000&token=" + token), Charset.defaultCharset()); + json = IOUtils.toString(new URL(this.url + "/api/v1/repos/search?limit=100000&token=" + this.token), Charset.defaultCharset()); this.repositories = (JSONArray) ((JSONObject) (new JSONParser().parse(json))).get("data"); } catch (IOException exception) diff --git a/src/fr/devinsy/statoolinfos/metrics/gsl/GSLProber.java b/src/fr/devinsy/statoolinfos/metrics/gsl/GSLProber.java index 87b9047..08e3635 100644 --- a/src/fr/devinsy/statoolinfos/metrics/gsl/GSLProber.java +++ b/src/fr/devinsy/statoolinfos/metrics/gsl/GSLProber.java @@ -24,8 +24,6 @@ import java.io.IOException; import java.util.Properties; import org.apache.commons.lang3.math.NumberUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import fr.devinsy.statoolinfos.core.StatoolInfosException; import fr.devinsy.statoolinfos.metrics.PathCounters; @@ -36,8 +34,6 @@ import fr.devinsy.strings.StringList; */ public class GSLProber { - private static Logger logger = LoggerFactory.getLogger(GSLProber.class); - /** * Instantiates a new GSL prober. */ diff --git a/src/fr/devinsy/statoolinfos/metrics/httpaccess/HttpAccessLog.java b/src/fr/devinsy/statoolinfos/metrics/httpaccess/HttpAccessLog.java index 390ca10..98291de 100644 --- a/src/fr/devinsy/statoolinfos/metrics/httpaccess/HttpAccessLog.java +++ b/src/fr/devinsy/statoolinfos/metrics/httpaccess/HttpAccessLog.java @@ -25,9 +25,6 @@ import java.time.format.DateTimeFormatter; import java.util.Locale; import java.util.regex.Pattern; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import fr.devinsy.statoolinfos.metrics.TimeMarkUtils; import fr.devinsy.strings.StringList; @@ -37,8 +34,6 @@ import fr.devinsy.strings.StringList; */ public class HttpAccessLog { - private static Logger logger = LoggerFactory.getLogger(HttpAccessLog.class); - public static final Pattern ASSET_PATTERN = Pattern.compile("^.*\\.(avi|css|gif|ico|jpeg|jpg|js|mp3|mp4|ogg|png|svg|wav) HTTP.*$"); private String ip; diff --git a/src/fr/devinsy/statoolinfos/metrics/httpaccess/HttpAccessLogAnalyzer.java b/src/fr/devinsy/statoolinfos/metrics/httpaccess/HttpAccessLogAnalyzer.java index 12a8f8c..1cd1113 100644 --- a/src/fr/devinsy/statoolinfos/metrics/httpaccess/HttpAccessLogAnalyzer.java +++ b/src/fr/devinsy/statoolinfos/metrics/httpaccess/HttpAccessLogAnalyzer.java @@ -23,8 +23,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import fr.devinsy.statoolinfos.core.StatoolInfosException; import fr.devinsy.statoolinfos.metrics.IpCounters; @@ -36,8 +34,6 @@ import fr.devinsy.strings.StringList; */ public class HttpAccessLogAnalyzer { - private static Logger logger = LoggerFactory.getLogger(HttpAccessLogAnalyzer.class); - private int ignoredLineCount; private int errorCount; private PathCounters counters; diff --git a/src/fr/devinsy/statoolinfos/metrics/httpaccess/HttpAccessLogParser.java b/src/fr/devinsy/statoolinfos/metrics/httpaccess/HttpAccessLogParser.java index 6e73a7a..e5b0de4 100644 --- a/src/fr/devinsy/statoolinfos/metrics/httpaccess/HttpAccessLogParser.java +++ b/src/fr/devinsy/statoolinfos/metrics/httpaccess/HttpAccessLogParser.java @@ -18,7 +18,6 @@ */ package fr.devinsy.statoolinfos.metrics.httpaccess; -import java.time.LocalDateTime; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; @@ -26,16 +25,11 @@ import java.util.Locale; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * The Class HttpAccessLogParser. */ public class HttpAccessLogParser { - private static Logger logger = LoggerFactory.getLogger(HttpAccessLogParser.class); - // log_format combined '$remote_addr - $remote_user [$time_local] ' // '"$request" $status $body_bytes_sent ' // '"$http_referer" "$http_user_agent"'; @@ -119,9 +113,6 @@ public class HttpAccessLogParser Matcher matcher = pattern.matcher(line); if (matcher.matches()) { - ZonedDateTime a = ZonedDateTime.now(); - LocalDateTime b = a.toLocalDateTime(); - result = new HttpAccessLog(); result.setIp(matcher.group("remoteAddress")); result.setRemoteUser(matcher.group("remoteUser")); diff --git a/src/fr/devinsy/statoolinfos/metrics/httpaccess/HttpAccessLogStat.java b/src/fr/devinsy/statoolinfos/metrics/httpaccess/HttpAccessLogStat.java index bca226d..aad6d1c 100644 --- a/src/fr/devinsy/statoolinfos/metrics/httpaccess/HttpAccessLogStat.java +++ b/src/fr/devinsy/statoolinfos/metrics/httpaccess/HttpAccessLogStat.java @@ -18,16 +18,11 @@ */ package fr.devinsy.statoolinfos.metrics.httpaccess; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * The Class HttpAccesLogStat. */ public class HttpAccessLogStat { - private static Logger logger = LoggerFactory.getLogger(HttpAccessLogStat.class); - private int hitCount; private int hitIpv4Count; private int hitIpv6Count; diff --git a/src/fr/devinsy/statoolinfos/metrics/httpaccess/HttpAccessLogs.java b/src/fr/devinsy/statoolinfos/metrics/httpaccess/HttpAccessLogs.java index a490c0e..3f39667 100644 --- a/src/fr/devinsy/statoolinfos/metrics/httpaccess/HttpAccessLogs.java +++ b/src/fr/devinsy/statoolinfos/metrics/httpaccess/HttpAccessLogs.java @@ -22,9 +22,6 @@ import java.io.File; import java.io.IOException; import java.util.Iterator; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import fr.devinsy.statoolinfos.util.Files; /** @@ -32,8 +29,6 @@ import fr.devinsy.statoolinfos.util.Files; */ public class HttpAccessLogs implements Iterable { - private static Logger logger = LoggerFactory.getLogger(HttpAccessLogs.class); - private Files source; private String pattern; private String datePattern; diff --git a/src/fr/devinsy/statoolinfos/metrics/httpaccess/HttpStatus.java b/src/fr/devinsy/statoolinfos/metrics/httpaccess/HttpStatus.java index 3b7240c..d3be5e9 100644 --- a/src/fr/devinsy/statoolinfos/metrics/httpaccess/HttpStatus.java +++ b/src/fr/devinsy/statoolinfos/metrics/httpaccess/HttpStatus.java @@ -18,16 +18,11 @@ */ package fr.devinsy.statoolinfos.metrics.httpaccess; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * The Class HttpStatus. */ public class HttpStatus { - private static Logger logger = LoggerFactory.getLogger(HttpStatus.class); - private int code; private String message; private String description; diff --git a/src/fr/devinsy/statoolinfos/metrics/httpaccess/HttpStatusTable.java b/src/fr/devinsy/statoolinfos/metrics/httpaccess/HttpStatusTable.java index 59e8c36..da2a765 100644 --- a/src/fr/devinsy/statoolinfos/metrics/httpaccess/HttpStatusTable.java +++ b/src/fr/devinsy/statoolinfos/metrics/httpaccess/HttpStatusTable.java @@ -21,23 +21,18 @@ package fr.devinsy.statoolinfos.metrics.httpaccess; import java.util.HashMap; import java.util.regex.Pattern; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * The Class HttpStatusTable. */ public class HttpStatusTable { + public static final Pattern HTTP_CODE_PATTERN = Pattern.compile("\\d{3}"); + private static class SingletonHolder { private static final HttpStatusTable instance = new HttpStatusTable(); } - private static Logger logger = LoggerFactory.getLogger(HttpStatusTable.class); - - public static final Pattern HTTP_CODE_PATTERN = Pattern.compile("\\d{3}"); - private HashMap codes; /** diff --git a/src/fr/devinsy/statoolinfos/metrics/httpaccess/UserAgent.java b/src/fr/devinsy/statoolinfos/metrics/httpaccess/UserAgent.java index 3d52ec8..ddbcb66 100644 --- a/src/fr/devinsy/statoolinfos/metrics/httpaccess/UserAgent.java +++ b/src/fr/devinsy/statoolinfos/metrics/httpaccess/UserAgent.java @@ -19,8 +19,6 @@ package fr.devinsy.statoolinfos.metrics.httpaccess; import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import fr.devinsy.strings.StringList; import fr.devinsy.strings.StringsUtils; @@ -30,8 +28,6 @@ import fr.devinsy.strings.StringsUtils; */ public class UserAgent { - private static Logger logger = LoggerFactory.getLogger(UserAgent.class); - private String source; /** diff --git a/src/fr/devinsy/statoolinfos/metrics/httpaccess/UserAgentBotDetector.java b/src/fr/devinsy/statoolinfos/metrics/httpaccess/UserAgentBotDetector.java index 1522ab0..59a5567 100644 --- a/src/fr/devinsy/statoolinfos/metrics/httpaccess/UserAgentBotDetector.java +++ b/src/fr/devinsy/statoolinfos/metrics/httpaccess/UserAgentBotDetector.java @@ -21,8 +21,6 @@ package fr.devinsy.statoolinfos.metrics.httpaccess; import java.io.IOException; import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import fr.devinsy.strings.StringList; import fr.devinsy.strings.StringsUtils; @@ -32,8 +30,6 @@ import fr.devinsy.strings.StringsUtils; */ public class UserAgentBotDetector { - private static Logger logger = LoggerFactory.getLogger(UserAgentBotDetector.class); - private static final StringList startList = new StringList(); private static final StringList containList = new StringList(); diff --git a/src/fr/devinsy/statoolinfos/metrics/httpaccess/Visit.java b/src/fr/devinsy/statoolinfos/metrics/httpaccess/Visit.java index f635191..9552872 100644 --- a/src/fr/devinsy/statoolinfos/metrics/httpaccess/Visit.java +++ b/src/fr/devinsy/statoolinfos/metrics/httpaccess/Visit.java @@ -23,17 +23,13 @@ import java.time.LocalDate; import java.time.LocalDateTime; import java.time.YearMonth; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.threeten.extra.YearWeek; /** - * The Class PathCounter. + * The Class Visit. */ public class Visit { - private static Logger logger = LoggerFactory.getLogger(Visit.class); - private LocalDateTime start; private LocalDateTime end; diff --git a/src/fr/devinsy/statoolinfos/metrics/httperrorlog/HttpErrorLog.java b/src/fr/devinsy/statoolinfos/metrics/httperrorlog/HttpErrorLog.java index a1361a5..482ae38 100644 --- a/src/fr/devinsy/statoolinfos/metrics/httperrorlog/HttpErrorLog.java +++ b/src/fr/devinsy/statoolinfos/metrics/httperrorlog/HttpErrorLog.java @@ -22,9 +22,6 @@ import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.Locale; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import fr.devinsy.statoolinfos.metrics.TimeMarkUtils; import fr.devinsy.strings.StringList; @@ -39,8 +36,6 @@ import fr.devinsy.strings.StringList; */ public class HttpErrorLog { - private static Logger logger = LoggerFactory.getLogger(HttpErrorLog.class); - private LocalDateTime time; private String level; private String message; diff --git a/src/fr/devinsy/statoolinfos/metrics/httperrorlog/HttpErrorLogAnalyzer.java b/src/fr/devinsy/statoolinfos/metrics/httperrorlog/HttpErrorLogAnalyzer.java index 49312a1..4ea7bfd 100644 --- a/src/fr/devinsy/statoolinfos/metrics/httperrorlog/HttpErrorLogAnalyzer.java +++ b/src/fr/devinsy/statoolinfos/metrics/httperrorlog/HttpErrorLogAnalyzer.java @@ -21,8 +21,6 @@ package fr.devinsy.statoolinfos.metrics.httperrorlog; import java.io.IOException; import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import fr.devinsy.statoolinfos.core.StatoolInfosException; import fr.devinsy.statoolinfos.metrics.PathCounters; @@ -33,8 +31,6 @@ import fr.devinsy.strings.StringList; */ public class HttpErrorLogAnalyzer { - private static Logger logger = LoggerFactory.getLogger(HttpErrorLogAnalyzer.class); - private PathCounters counters; /** diff --git a/src/fr/devinsy/statoolinfos/metrics/httperrorlog/HttpErrorLogParser.java b/src/fr/devinsy/statoolinfos/metrics/httperrorlog/HttpErrorLogParser.java index 94435b1..9d7e687 100644 --- a/src/fr/devinsy/statoolinfos/metrics/httperrorlog/HttpErrorLogParser.java +++ b/src/fr/devinsy/statoolinfos/metrics/httperrorlog/HttpErrorLogParser.java @@ -25,16 +25,11 @@ import java.util.Locale; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - /** * The Class HttpErrorLogParser. */ public class HttpErrorLogParser { - private static Logger logger = LoggerFactory.getLogger(HttpErrorLogParser.class); - public static final Pattern APACHE_ERROR_PATTERN = Pattern.compile("^\\[(?