So if I get it right, you want to compare two URL's, regardless of the order of the query part.
There does not seem to be a method for this in the URL
class, so you'll have to write your own.
Also, URL
is final
, you cannot override URL.equals(Object)
.
Your method could start with calling sameFile()
.
If that evaluates to true
, you then call getQuery()
, and split it into it's components - probably with String.split("\&"). From there on, you evaluate if the parameters are the same.
Also, don't forget to check if the "#fragment" is equal, if that is important to your application.