Stack Exchange
Using java.net.URLConnection with a GET, how to get redirect URL?
Using java.net.URLConnection, with a GET on a specific URL, this specific URL will redirect to a new page.  How do I get that new URL from the response?

possible duplicate of https://stackoverflow.com/questions/2659000/java-how-to-find-the-redirected-url-of-a-url may be this u need

Given Rishal's link and amobiz's answer was what I was looking for:
URLConnection con = new URL( url ).openConnection();
System.out.println( "orignal url: " + con.getURL() );
con.connect();
System.out.println( "connected url: " + con.getURL() );
InputStream is = con.getInputStream();
System.out.println( "redirected url: " + con.getURL() );
is.close();

