Just to make myself clear - I am looking for an ASP.NET MVC solution, not a java one.
I have lot of image Urls in my site and I need to determine whether they are relative paths of the web application or absolute paths.
If the Url is relative path I can call a function that generates an absolute path from the relative one.
If the Url is external path it means its already the full absolute path and therefore this function call is not needed.
I thought about checking if the string starts with "http" or "www" and than it means its an absolute path, but it doesn't match all the options like zaza-bu.blala.fr/coolimage.png.
The only thing I have that can work is just trying to access the Url generated after this function. if the Url is accessable - than it was relative and the Url is valid, If not - it was a an absolute path, and I need to take the string before the function call, but its too hacky and slow.
I am using c# ASP.NET 4 for that.
Thanks in advance.