Hello Eugeny,

> http://somedomain.com/path1?query1 and http://somedomain.com/path2?query2
> should be considered as same url, but

why should /path1 be considered the same as /path2?
It doesn't make sense to me, but it doesn't have to.

> http://somedomain.com/~username1 and http://somedomain.com/~username2 are not,
> 
> and finally
> 
> http://somedomain.com/~username1/path1 and
> http://somedomain.com/~username1/path2?query should be considered as same.
> 
> Is there any way I can perform this validation using URI class?

If you expect the URI class to figure out what anybody might consider
same or different, the answer is no. If you understand that it is your
application that needs to do the comparison and the URI class is used
only to hold the URIs, the answer is yes.
What you have to do is to pick everything that is relevant for the
comparison, and remove everything that should be ignored. Such a step
is called normalization. Once you have your URLs normalized, you can
then use plain .equals() to check whether they are equal.

cheers,
  Roland

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to