My Java standalone application gets a URL (which points to a file) from the user and I need to hit it and download it. The problem I am facing is that I am not able to encod
You can also use GUAVA and path escaper: UrlEscapers.urlFragmentEscaper().escape(relativePath)
GUAVA
UrlEscapers.urlFragmentEscaper().escape(relativePath)