Here\'s a simple problem - given two urls, is there some built-in method, or an Apache library that decides whether they are (logically) equal?
For example, these tw
sameFile
public boolean sameFile(URL other)Compares two URLs,
excluding the fragment component. Returns true if this URL and the other argument are equal without taking the fragment component into consideration.
Parameters: other - the URL to compare against. Returns: true if they reference the same remote object; false otherwise.
also please go through this link
http://download.oracle.com/javase/6/docs/api/java/net/URL.html#sameFile(java.net.URL)
As iam unable to add comment , browser throwing Javascript error. so iam adding my comment here. regret for inconvience.
//this what i suggeted
>URL url1 = new URL("http://stackoverflow.com/foo");
>URL url2 = new URL("http://stackoverflow.com/foo/");
>System.out.println(url1.sameFile(url2));
// this is suggested by Joachim Sauer
>URI uri = new URI("http://stackoverflow.com/foo/");
>System.out.println(uri.equals("http://stackoverflow.com/foo"));
// Both are giving same result
so Joachim Sauer check once.