Java: fix for if the url is encoded

check if the url is encoded then decode, clean up error message