Skip to content

Commit

Permalink
Merge pull request #47 from AQLT/develop
Browse files Browse the repository at this point in the history
`replace` parameter of `save_workspace()` corrected in R (not in Java)
  • Loading branch information
AQLT authored Oct 31, 2024
2 parents 3ea577d + e2e8fed commit bdc8d0b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

* Correction of imports when the workspace contains no SAP.

* `replace` parameter of `save_workspace()` corrected in R (not in Java).

## [3.2.3] - 2024-07-12


Expand Down
9 changes: 8 additions & 1 deletion R/workspace.R
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,14 @@ read_workspace <- function(jws, compute = TRUE) {
save_workspace <- function(jws, file, replace = FALSE) {
# version <- match.arg(tolower(version)[1], c("jd3", "jd2"))
version <- "jd3"
invisible(.jcall(jws, "Z", "saveAs", full_path(file), version, !replace))
file <- full_path(file)
if (replace && file.exists(file)) {
base::file.remove(file)
base::unlink(
gsub("\\.xml$", "", file),
recursive = TRUE)
}
invisible(.jcall(jws, "Z", "saveAs", file, version, !replace))
}

full_path <- function(path) {
Expand Down

0 comments on commit bdc8d0b

Please sign in to comment.