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
I've created a new project to help construct HTTP URLs. The library will automatically URL encode path segments and query parameters.
You can view the source and download a binary at https://github.com/Widen/urlbuilder
The example URL in this question:
new UrlBuilder("search.barnesandnoble.com", "booksearch/first book.pdf").toString()
produces
http://search.barnesandnoble.com/booksearch/first%20book.pdf