I have the following piece of Java code:
HttpURLConnection connection = (HttpURLConnection)new URL(url).openConnection();
connection.setRequestProperty("User-Agent","");
connection.setInstanceFollowRedirects(true);
int responseCode = connection.getResponseCode();
When the response-code is 300, how can I extract the URLs that are provided within the response body?
Thanks