rkrug / plantuml

R package to build UML graphs using plantuml
https://rkrug.github.io/plantuml/index.html
GNU General Public License v3.0
76 stars 8 forks source link

Invalid or corrupt jarfile #12

Closed retorquere closed 4 years ago

retorquere commented 4 years ago

When I let the package download the jarfile on Windows, I get "Invalid or corrupt jarfile" (when ran from the package or when ran from the command line with java -jar). When downloading directly from the plantuml site it does work.

rkrug commented 4 years ago

‘update_plantuml()’ is downloading from https://sourceforge.net/projects/plantuml/files/latest/download which is the official address. Just try it again. But this is out of my control, when the official download is corrupt.

retorquere commented 4 years ago

I've tried it again, but on two separate Windows systems I've hit this problem with Windows (not on Mac or Linux) even after the first update (it seems update_plantuml() has changed to updatePlantumlJar() BTW).

I've looked into the docs for download.file and I see:

On Windows, if mode is not supplied (missing()) and url ends in one of .gz, .bz2, .xz, .tgz, .zip, .rda, .rds or .RData, mode = "wb" is set such that a binary transfer is done to help unwary users.

but since the download url for the jar ends in jar or download, it may be that it is written with mode wa, and that would corrupt the file. The default for mode is w but I don't know if that becomes wa or wb on windows.

rkrug commented 4 years ago

I am at the moment testing locally when I set mode = "wb".

OK - uploaded it to dev. Please install with

devtools::install_github("rkrug/plantuml", ref = "dev")

Please let me know if it fixes this issue, and I will push it to master.

retorquere commented 4 years ago

That works in the tests I've done here.

rkrug commented 4 years ago

OK - thanks. Will push it to master.

rkrug commented 4 years ago

Thanks - is in master

retorquere commented 4 years ago

Tested that too -- works!