This is the encoding method for java.net.URL classes Important Note: if the URL contains an #, the URL class treats it as a reference (i.e. a link inside the page). For instance, the following path /pathwhatever#1/index.html will manage the following way
- Path: /pathwhatever
- Ref: #1/index.html
So if the URL contains # chars in the middle somehow, avoid to use this method and pass a String over instead
@param url the URL object
@return the encoded Url