Lines 17-20
Link Here
|
17 |
import java.lang.reflect.InvocationTargetException; |
17 |
import java.lang.reflect.InvocationTargetException; |
18 |
import java.lang.reflect.Method; |
18 |
import java.lang.reflect.Method; |
|
|
19 |
import java.net.HttpURLConnection; |
19 |
import java.net.JarURLConnection; |
20 |
import java.net.JarURLConnection; |
20 |
import java.net.MalformedURLException; |
21 |
import java.net.MalformedURLException; |
Lines 815-820
Link Here
|
815 |
JarURLConnection connection2 = null; |
816 |
JarURLConnection connection2 = null; |
816 |
try { |
817 |
try { |
817 |
URL docUrl = new URL(docUrlValue); |
818 |
URL docUrl = null; |
818 |
URLConnection connection = docUrl.openConnection(); |
819 |
URLConnection connection = null; |
|
|
820 |
redirect: do { |
821 |
docUrl = new URL(docUrlValue); |
822 |
connection = docUrl.openConnection(); |
823 |
|
824 |
if (connection instanceof HttpURLConnection) { |
825 |
HttpURLConnection httpCon = (HttpURLConnection) connection; |
826 |
if (httpCon.getResponseCode() == 301) { |
827 |
docUrlValue = httpCon.getHeaderField("location"); //$NON-NLS-1$ |
828 |
continue redirect; |
829 |
} |
830 |
} |
831 |
break; |
832 |
} while (docUrlValue != null); |
833 |
|
819 |
Class[] parameterTypes = new Class[]{int.class}; |
834 |
Class[] parameterTypes = new Class[]{int.class}; |
820 |
Integer timeoutVal = new Integer(10000); |
835 |
Integer timeoutVal = new Integer(10000); |
Lines 852-855
Link Here
|
852 |
return null; |
867 |
return null; |
853 |
} |
868 |
} |
|
|
869 |
|
854 |
String encoding = connection.getContentEncoding(); |
870 |
String encoding = connection.getContentEncoding(); |
855 |
byte[] contents = org.eclipse.jdt.internal.compiler.util.Util.getInputStreamAsByteArray(stream, connection.getContentLength()); |
871 |
byte[] contents = org.eclipse.jdt.internal.compiler.util.Util.getInputStreamAsByteArray(stream, connection.getContentLength()); |