Details
Description
GeorectifyCoverage constructs gdal_translate command lines as strings without any consideration of arguments such as filenames containing spaces that might require quoting.
For example, building with -Djava.io.tmpdir=target in a path with spaces fails:
Tests in error: testGeorectify(org.geoserver.wps.gs.GeorectifyCoverageTest): Error launching OS command: 'gdal_translate' with arguments '-of VRT -gcp 183 33 -74.01183158 40.70852996 -gcp 103 114 -74.01083751 40.70754684 -gcp 459 298 -74.00857344 40.71194565 -gcp 252 139 -74.01053024 40.70938712 /home/ben/geoserver/src with spaces/geoserver/src/extension/wps/wps-core/target/readCoverage6331435335797481973.tif /home/ben/geoserver/src with spaces/geoserver/src/extension/wps/wps-core/target/vrt_4681318640566863810.vrt' and env vars 'null': (..)
Rather than trying to add argument quoting and then preserve it through String split and join operations, a better approach is pass arguments lists as List<String> and let ProcessBuilder do all the argument quoting. This is a more idiomatic use of ProcessBuilder.
Attachments
Issue links
- links to