diff --git a/DESCRIPTION b/DESCRIPTION index df9c3978e1a0c4a48b275d99e0b5118dcd4f84a8..b12eba6b84a9e1d94e1a9c9a8d496e7adab2484b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: airGRteaching Type: Package Title: Teaching Hydrological Modelling with the GR Rainfall-Runoff Models ('Shiny' Interface Included) -Version: 0.2.8.69 -Date: 2020-02-28 +Version: 0.2.9.0 +Date: 2020-03-24 Authors@R: c( person("Olivier", "Delaigue", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7668-8468"), email = "airGR@inrae.fr"), person("Laurent", "Coron", role = c("aut"), comment = c(ORCID = "0000-0002-1503-6204")), diff --git a/NAMESPACE b/NAMESPACE index 6f16c371f9a5e764e1315eaa45cd66fc9788fe86..92e2e83c60b68f71be2e566f3c7938bf42e8d857 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -36,6 +36,7 @@ exportPattern(".DiagramGR") exportPattern(".TypeModelGR") exportPattern(".StartStop") exportPattern(".DyShadingMulti") +exportPattern(".CheckUrl") diff --git a/NEWS.md b/NEWS.md index a233da74d491e551b1c3eda5c575c22e34de936e..c7acd73e3bf8430d48283db594f0d7963a5c8d18 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,11 @@ +### 0.2.9.0 Release Notes (2020-03-24) + +____________________________________________________________________________________ + + ### 0.2.8.69 Release Notes (2020-02-28) diff --git a/R/Utils.R b/R/Utils.R index a6a34b6e3600d385c53ea32acb65eaf086446489..0f1df34138d95e8202c31c158a8b6bbbeb3b55b3 100644 --- a/R/Utils.R +++ b/R/Utils.R @@ -25,6 +25,20 @@ if (getRversion() >= "2.15.1") { +## ================================================================================= +## function to test if a remote url exists +## ================================================================================= + +.CheckUrl <- function(url, timeout = 2) { + con <- url(description = url) + check <- suppressWarnings(try(open.connection(con = con, open = "rt", timeout = t), silent = TRUE)[1]) + suppressWarnings(try(close.connection(con), silent = TRUE)) + is.null(check) +} + + + + ## ================================================================================= ## function to compute the start and stop id of equal values in a vector ## =================================================================================