R/check_java_path.R

Defines functions check_java_path

#' @title Checking JavaSTICS directory content
#'
#' @description Checking if directory exists and if it contains JavaSTICS jar
#' files
#' @details Rising an exception for each checking step !
#' @param javastics JavaSTICS installation root folder
#'
#' @examples
#' \dontrun{
#' check_java_path("/path/to/JavaSTICS/folder")
#' }
#'
#' @keywords internal
#'
#' @noRd
#'
check_java_path <- function(javastics) {
  if (!file.exists(javastics)) {
    stop("The JavaSTICS folder doesn't exist : ", javastics)
  }

  # checking if it's a JavaSTICS root directory
  if (
    !file.exists(file.path(javastics, "JavaStics.exe")) &&
      !file.exists(file.path(javastics, "JavaStics.jar"))
  ) {
    stop("This directory is not a JavaSTICS one: ", javastics)
  }
}
SticsRPacks/SticsRFiles documentation built on July 4, 2025, 4:19 p.m.