Don't use URLEncoder but use URIUtil.encodePath to handle paths with
spaces correctly