From 47d4a62ac7eca81ce3daccb82b101e1adb996389 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Sun, 16 May 2021 11:46:11 +0200 Subject: [PATCH] Updated crawled file compute in case of 1970 date. --- .../devinsy/statoolinfos/core/Federation.java | 20 +++++++++++++++++++ .../statoolinfos/core/Organization.java | 20 +++++++++++++++++++ src/fr/devinsy/statoolinfos/core/Service.java | 20 +++++++++++++++++++ 3 files changed, 60 insertions(+) diff --git a/src/fr/devinsy/statoolinfos/core/Federation.java b/src/fr/devinsy/statoolinfos/core/Federation.java index 2dd31a7..c071616 100644 --- a/src/fr/devinsy/statoolinfos/core/Federation.java +++ b/src/fr/devinsy/statoolinfos/core/Federation.java @@ -122,6 +122,21 @@ public class Federation extends PathPropertyList return result; } + /** + * Gets the crawl date. + * + * @return the crawl date + */ + public LocalDateTime getCrawlDate() + { + LocalDateTime result; + + result = LocalDateTime.parse(get("crawl.datetime")); + + // + return result; + } + /** * Gets the crawled date. * @@ -133,6 +148,11 @@ public class Federation extends PathPropertyList result = LocalDateTime.parse(get("crawl.file.datetime")); + if (result.getYear() == 1970) + { + result = getCrawlDate(); + } + // return result; } diff --git a/src/fr/devinsy/statoolinfos/core/Organization.java b/src/fr/devinsy/statoolinfos/core/Organization.java index 9d3180c..9ccc376 100644 --- a/src/fr/devinsy/statoolinfos/core/Organization.java +++ b/src/fr/devinsy/statoolinfos/core/Organization.java @@ -130,6 +130,21 @@ public class Organization extends PathPropertyList return result; } + /** + * Gets the crawl date. + * + * @return the crawl date + */ + public LocalDateTime getCrawlDate() + { + LocalDateTime result; + + result = LocalDateTime.parse(get("crawl.datetime")); + + // + return result; + } + /** * Gets the crawled date. * @@ -141,6 +156,11 @@ public class Organization extends PathPropertyList result = LocalDateTime.parse(get("crawl.file.datetime")); + if (result.getYear() == 1970) + { + result = getCrawlDate(); + } + // return result; } diff --git a/src/fr/devinsy/statoolinfos/core/Service.java b/src/fr/devinsy/statoolinfos/core/Service.java index 13176f5..450e09d 100644 --- a/src/fr/devinsy/statoolinfos/core/Service.java +++ b/src/fr/devinsy/statoolinfos/core/Service.java @@ -188,6 +188,21 @@ public class Service extends PathPropertyList return result; } + /** + * Gets the crawl date. + * + * @return the crawl date + */ + public LocalDateTime getCrawlDate() + { + LocalDateTime result; + + result = LocalDateTime.parse(get("crawl.datetime")); + + // + return result; + } + /** * Gets the crawled date. * @@ -199,6 +214,11 @@ public class Service extends PathPropertyList result = LocalDateTime.parse(get("crawl.file.datetime")); + if (result.getYear() == 1970) + { + result = getCrawlDate(); + } + // return result; }